public void DoDeInit() { if (this.objectState >= ObjectState.DeInitializing) { Debug.LogWarning("Object is out of state: " + this, this); return; } this.SetState(ObjectState.DeInitializing); for (int i = 0; i < this.subObjects.Count; ++i) { this.subObjects[i].DoDeInit(); } WindowSystem.RaiseEvent(this, WindowEvent.OnDeInitialize); this.OnDeInit(); this.OnDeInitInternal(); this.SetState(ObjectState.DeInitialized); WindowSystem.ClearEvents(this); }