| | |
| | | EditorGUILayout.BeginVertical(gUISkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | _mapData.showTriggerList = EditorGUILayout.Foldout(_mapData.showTriggerList, " 触发器列表", true, gUISkin.toggle); |
| | | _mapData.showTriggerList = EditorGUILayout.Foldout(_mapData.showTriggerList, " 触发器列表", true, gUISkin.customStyles[3]); |
| | | EditorGUI.indentLevel -= 1; |
| | | if (GUILayout.Button("添加", gUISkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | |
| | | EditorGUILayout.BeginVertical(gUISkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | _mapData.showEventList = EditorGUILayout.Foldout(_mapData.showEventList, " 事件列表", true, gUISkin.toggle); |
| | | _mapData.showEventList = EditorGUILayout.Foldout(_mapData.showEventList, " 事件列表", true, gUISkin.customStyles[3]); |
| | | EditorGUI.indentLevel -= 1; |
| | | eventType = (Evt.E_EventType)EditorGUILayout.EnumPopup(eventType, gUISkin.box, GUILayout.Height(22), GUILayout.Width(100)); |
| | | if (GUILayout.Button("添加", gUISkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | |
| | | EditorGUILayout.BeginVertical(gUISkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | _mapData.showTransferList = EditorGUILayout.Foldout(_mapData.showTransferList, " 传送组列表", true, gUISkin.toggle); |
| | | _mapData.showTransferList = EditorGUILayout.Foldout(_mapData.showTransferList, " 传送组列表", true, gUISkin.customStyles[3]); |
| | | EditorGUI.indentLevel -= 1; |
| | | if (GUILayout.Button("添加", gUISkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | |
| | | /// 传送点列表 End |
| | | /// -------------------------------------------------------------------------------- |
| | | |
| | | /// -------------------------------------------------------------------------------- |
| | | /// 场景物件列表 Start |
| | | |
| | | /// 场景物件列表 End |
| | | /// -------------------------------------------------------------------------------- |
| | | |
| | | EditorGUILayout.EndVertical(); |
| | | |
| | | if (GUI.changed) |
| | |
| | | |
| | | if (type == Evt.E_EventType.Enemy) |
| | | { |
| | | var _event = CreateNewGO(Bhv_MapData.NodeName_Event + RequestEventID()); |
| | | var _event = CreateNewGO(Bhv_MapData.NodeName_Event + "RefreshEvemy_" + RequestEventID()); |
| | | var _eventBhv = _event.AddComponent<Bhv_Evt_RefreshMonster>(); |
| | | _eventBhv.type = type; |
| | | _event.transform.SetParent(_mapData.transform.Find(Bhv_MapData.NodeName_EventList)); |
| | | _mapData.eventList.Add(_eventBhv); |
| | | |
| | | _event.transform.position = SceneCameraRaycastPosition(); |
| | | } |
| | | else if (type == Evt.E_EventType.SceneObject) |
| | | { |
| | | var _event = CreateNewGO(Bhv_MapData.NodeName_Event + "RefreshSceneObject_" + RequestEventID()); |
| | | var _eventBhv = _event.AddComponent<Bhv_Evt_RefreshSceneObject>(); |
| | | _eventBhv.type = type; |
| | | _event.transform.SetParent(_mapData.transform.Find(Bhv_MapData.NodeName_EventList)); |
| | | _mapData.eventList.Add(_eventBhv); |
| | | |
| | | _event.transform.position = SceneCameraRaycastPosition(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static Vector3 SceneCameraRaycastPosition() |
| | | { |
| | | RaycastHit _hit; |
| | | Ray _ray = SceneView.lastActiveSceneView.camera.ViewportPointToRay(new Vector3(.5f, .5f, 0)); |
| | | if (Physics.Raycast(_ray, out _hit, 1000f, LayerUtility.WalkbleMask)) |
| | | { |
| | | return _hit.point; |
| | | } |
| | | |
| | | return Vector3.zero; |
| | | } |
| | | } |
| | | } |