protected override void OnDestroy() { base.OnDestroy(); CleanUpCallbacks(UnityLogic.Options.ViewMode); UnityLogic.Options.OnChanged_ViewMode -= Callback_NewViewMode; if (TileHighlighter.Instance != null) { TileHighlighter.Instance.DestroyHighlight(mouseTileHighlight); foreach (ulong id in tileHighlights.Values) { TileHighlighter.Instance.DestroyHighlight(id); } } if (UnityLogic.EtMGame.InstanceExists) { UnityLogic.EtMGame.Instance.Map.Tiles.OnTileChanged -= Callback_TileChanged; } if (instance == this) { instance = null; } }
protected override void Awake() { base.Awake(); //If another instance was already open, close it. if (instance != null) { instance.Callback_Cancel(); } instance = this; }