Esempio n. 1
0
        protected override void OnDestroy()
        {
            if (this._chatServiceMultiplexer != null)
            {
                try {
                    this._chatServiceMultiplexer.OnJoinChannel               -= this.QueueOrSendOnJoinChannel;
                    this._chatServiceMultiplexer.OnTextMessageReceived       -= this.QueueOrSendOnTextMessageReceived;
                    this._chatServiceMultiplexer.OnChatCleared               -= this.QueueOrSendOnClearChat;
                    this._chatServiceMultiplexer.OnMessageCleared            -= this.QueueOrSendOnClearMessage;
                    this._chatServiceMultiplexer.OnChannelResourceDataCached -= this.QueueOrSendOnChannelResourceDataCached;
                }
                catch (Exception e) {
                    Logger.Error(e);
                }
                BSEvents.lateMenuSceneLoadedFresh -= this.BSEvents_menuSceneLoadedFresh;
            }
            if (this._chatCoreInstance != null)
            {
#if DEBUG
                this._chatCoreInstance.OnLogReceived -= this._sc_OnLogReceived;
#endif
                try {
                    this._chatCoreInstance.StopAllServices();
                }
                catch (Exception e) {
                    Logger.Error(e);
                }
            }

            MainThreadInvoker.ClearQueue();
            ChatImageProvider.ClearCache();
            base.OnDestroy();
        }
 private void BSEvents_menuSceneLoadedFresh()
 {
     if (_chatDisplay != null)
     {
         DestroyImmediate(_chatDisplay.gameObject);
         _chatDisplay = null;
         MainThreadInvoker.ClearQueue();
     }
     _chatDisplay = BeatSaberUI.CreateViewController <ChatDisplay>();
 }
Esempio n. 3
0
 private void BSEvents_menuSceneLoadedFresh(ScenesTransitionSetupDataSO scenesTransitionSetupDataSo)
 {
     if (this._chatDisplay)
     {
         DestroyImmediate(this._chatDisplay.gameObject);
         this._chatDisplay = null;
         MainThreadInvoker.ClearQueue();
     }
     this._chatDisplay = BeatSaberUI.CreateViewController <ChatDisplay>();
     this._chatDisplay.gameObject.SetActive(true);
 }
 public void OnDisable()
 {
     if (_svcs != null)
     {
         _svcs.OnJoinChannel               -= QueueOrSendOnJoinChannel;
         _svcs.OnTextMessageReceived       -= QueueOrSendOnTextMessageReceived;
         _svcs.OnChatCleared               -= QueueOrSendOnClearChat;
         _svcs.OnMessageCleared            -= QueueOrSendOnClearMessage;
         _svcs.OnChannelResourceDataCached -= QueueOrSendOnChannelResourceDataCached;
         BSEvents.menuSceneLoadedFresh     -= BSEvents_menuSceneLoadedFresh;
     }
     if (_sc != null)
     {
         //_sc.OnLogReceived -= _sc_OnLogReceived;
         _sc.StopAllServices();
     }
     if (_chatDisplay != null)
     {
         Destroy(_chatDisplay.gameObject);
         _chatDisplay = null;
     }
     MainThreadInvoker.ClearQueue();
     ChatImageProvider.ClearCache();
 }