public void OnSceneGUI() { if (_octave.gameObject.activeSelf && _octave.enabled && !Application.isPlaying) { KeyboardButtonStates.Instance.RepairCTRLAndCMDStates(); // Just make sure that the transform tools are hidden. They can really get in the // way sometimes. Tools.current = Tool.None; _octave.Inspector.EditorWindow = this; // Note: This should not be necessary because we could set this in the 'OnEnable' method, // but there were a couple of times when it somehow got reset. I do not know what happened, so // I decided to take the easy way out and just set it here every time. Same thing in 'OnInspectorGUI'. if (ToolSupervisor.Get() != null) { ToolSupervisor.Get().Supervise(); } _octave.Octave3DScene.OnSceneGUI(); _octave.SceneRenderer.RenderHandles(); var sceneViewEventHandler = SceneViewEventHandlerFactory.Create(_octave.Inspector.ActiveInspectorGUIIdentifier); if (sceneViewEventHandler != null) { sceneViewEventHandler.HandleSceneViewEvent(Event.current); } } }
public void OnSceneGUI() { if (_octave.gameObject.activeSelf && _octave.enabled && !Application.isPlaying) { KeyboardButtonStates.Instance.RepairCTRLAndCMDStates(); // Just make sure that the transform tools are hidden. They can really get in the // way sometimes. Tools.current = Tool.None; _octave.Inspector.EditorWindow = this; // Note: This should not be necessary because we could set this in the 'OnEnable' method, // but there were a couple of times when it somehow got reset. I do not know what happened, so // I decided to take the easy way out and just set it here every time. Same thing in 'OnInspectorGUI'. if (ToolSupervisor.Get() != null) { ToolSupervisor.Get().Supervise(); } /*if (Event.current.type == EventType.keyDown) * { * if (Event.current.keyCode == KeyCode.P) * { * string path = "Assets"; * string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New " + typeof(PrefabCategoryDatabase).ToString() + ".asset"); * * AssetDatabase.CreateAsset(PrefabCategoryDatabase.Get(), assetPathAndName); * * AssetDatabase.SaveAssets(); * AssetDatabase.Refresh(); * //EditorUtility.FocusProjectWindow(); * } * }*/ _octave.Octave3DScene.OnSceneGUI(); _octave.SceneRenderer.RenderHandles(); var sceneViewEventHandler = SceneViewEventHandlerFactory.Create(_octave.Inspector.ActiveInspectorGUIIdentifier); if (sceneViewEventHandler != null) { sceneViewEventHandler.HandleSceneViewEvent(Event.current); } } }