Currently working on a custom editor script, my handles keep hiding when I select an other gameobject which doesn’t have the script attached.
The question has already been posted but I couldn’t find a proper (complete and well explained) way of solving this. I’m trying to get the solution posted by @whydoidoit to work, but as long as Sceneview is not documented I am still struggling!
Here is the solution, replace your OnSceneGUI() function with CustomOnSceneGUI()
using UnityEditor;
using System;
[CustomEditor(typeof(BaseClass))]
public class BaseClassCustomEditor : Editor {
void OnEnable()
{
SceneView.onSceneGUIDelegate += (SceneView.OnSceneFunc)Delegate.Combine(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(CustomOnSceneGUI));
}
void CustomOnSceneGUI(SceneView sceneview)
{
//Work here !
}
}