🤔

OnSceneGUI not called: Scriptable Object#

Editor.OnSceneGUI isn't called for editors of ScriptableObjects.

Resolution#

Subscribe to the duringSceneGui callback (formerly onSceneGUIDelegate).

private void OnEnable() => SceneView.duringSceneGui += DuringSceneGUI;

private void OnDisable() => SceneView.duringSceneGui -= DuringSceneGUI;

private void DuringSceneGUI(SceneView obj)
{
// implementation here
}
 

The GUI will only show when an appropriate target is selected. If you don't want this behaviour, it may be better to make a custom EditorWindow, a custom EditorTool, or subscribe to the SceneView callback from a method decorated with a InitializeOnLoadMethodAttribute. Each come with their own benefits and drawbacks depending on what behaviour is needed.


OnSceneGUI is still not called.