Hi George, I think this ought to work even in the editor, just be careful to manage your instances.
static MonoBehaviour CreateBehaviour()
{
GameObject go = new GameObject("EditorBehaviour");
GameObject.DontDestroyOnLoad(go);
go.hideFlags = HideFlags.HideAndDontSave;
return go.AddComponent<MonoBehaviour>();
}
Comments are closed.