static StatechartEngine GetInstance() { if (dead) { return(null); } if (instance == null) { GameObject obj = new GameObject(); DontDestroyOnLoad(obj); instance = obj.AddComponent <StatechartEngine>(); } return(instance); }
void OnDisable() { StatechartEngine.RemoveInstance(this); }
void OnEnable() { StatechartEngine.AddInstance(this); }