OnSceneGUI In Editor Window
This is how you can get OnSceneGUI features like Handles to work on EditorWindows.
private void OnEnable()
{
// Ensure that there is no delegate callback
SceneView.duringSceneGui -= OnSceneGUI;
// Define the callback for the delegate
SceneView.duringSceneGui += OnSceneGUI;
}
private void OnDestroy()
{
// After the editor window is destroyed, remove the callback
SceneView.duringSceneGui -= OnSceneGUI;
}
private void OnSceneGUI(SceneView sceneView)
{
// Here you can use OnSceneGUI features like Handles
}
No Comments