Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 private void SecondaryTimerCheck()
 {
     OnSecondaryTimeCheck.Invoke();
 }
Exemplo n.º 3
0
 public void RemoveSecondaryTimerListener(UnityAction action)
 {
     OnSecondaryTimeCheck.RemoveListener(action);
 }
Exemplo n.º 4
0
 public void AddSecondaryTimerListener(UnityAction action)
 {
     OnSecondaryTimeCheck.AddListener(action);
 }