Hi,
I don’t understand how OnDestroy() and OnDisable() are supposed to work in custom editor scripts.
On the scene I have gameobject with script Manager
attached. Besides I have custom editor script ManagerEditor
:
[CustomEditor(typeof(Manager))]
[InitializeOnLoad]
public class ManagerEditor : Editor
{
public void OnDisable()
{
Debug.Log("Disable Editor");
}
public void OnDestroy()
{
Debug.Log("Destroy Editor");
}
}
Why, every time, I unselect this object (gameobject with Manager
attached) in hierarchy window, I see both Debug.Log messages (Disable Editor and Destroy Editor) ?
OnDestroy and OnDisable means losing focus ?
Thank you for clarifying this.