public void OnDestroy() { // since we are using threads to do our work (networking, ..) // away of unity's default classes, we need to shutdown things // to avoid errors in the console while debugging if (ProtocolGame != null && ProtocolGame.IsGameRunning) { ProtocolGame.Disconnect(); // force disconnection (by trying to logout) } AppearanceStorage.UnloadSpriteProvider(); OnSecondaryTimeCheck.RemoveAllListeners(); CancelInvoke("SecondaryTimerCheck"); CancelInvoke("SaveMiniMap"); OptionStorage = null; InputHandler = null; AppearanceStorage = null; CreatureStorage = null; MiniMapStorage = null; MiniMapRenderer = null; WorldMapStorage = null; WorldMapRenderer = null; ChatStorage = null; MessageStorage = null; WorldMapRenderingTexture.Release(); MiniMapRenderingTexture.Release(); }
private void SecondaryTimerCheck() { OnSecondaryTimeCheck.Invoke(); }
public void RemoveSecondaryTimerListener(UnityAction action) { OnSecondaryTimeCheck.RemoveListener(action); }
public void AddSecondaryTimerListener(UnityAction action) { OnSecondaryTimeCheck.AddListener(action); }