/// <summary>Opens the its view by activating itself and deactiving the current active view</summary> private void OpenProgressionView() { activeProgressionLevel.SetActiveState(false); SetActiveState(true); activeProgressionLevel = this; }
private void OnEnable() { if (activeOnAwake) { activeProgressionLevel = this; SetActiveState(true); } }
private void OnDisable() { if (activeOnAwake && activeProgressionLevel == this) { activeProgressionLevel = null; } SetActiveState(false); }
protected override void OnDestroy() { base.Awake(); button.onClick.RemoveListener(OpenProgressionView); if (activeProgressionLevel == this) { activeProgressionLevel = null; } }