protected virtual void OnDisable()
 {
     SignalBus.Unsubscribe <LevelLoadNextSignal>(LevelLoad);
     SignalBus.Unsubscribe <LevelStartSignal>(LevelStart);
     SignalBus.Unsubscribe <LevelCompleteSignal>(LevelComplete);
     SignalBus.Unsubscribe <LevelFailSignal>(LevelFail);
 }
Пример #2
0
 private void OnDisable()
 {
     m_signalBus.Unsubscribe <LevelLoadSignal>(LevelLoaded);
     m_signalBus.Unsubscribe <LevelStartSignal>(LevelStarted);
     m_signalBus.Unsubscribe <LevelCompleteSignal>(LevelComplete);
     m_signalBus.Unsubscribe <LevelFailSignal>(LevelFail);
 }
 public void Dispose()
 {
     _signalBus.Unsubscribe <OpenScreenRequestSignal>(OnOpenScreenRequest);
     _signalBus.Unsubscribe <CloseScreenRequestSignal>(OnCloseScreenRequest);
     _signalBus.Unsubscribe <CloseAllScreensRequestSignal>(OnCloseAllScreensRequest);
     _signalBus.Unsubscribe <ScreenStateChangedSignal>(OnScreenStateChanged);
 }
Пример #4
0
 void OnDisable()
 {
     signalBus.Unsubscribe <EmptynessInside>(LeftDown, "LeftFlipperDown");
     signalBus.Unsubscribe <EmptynessInside>(LeftUp, "LeftFlipperUp");
     signalBus.Unsubscribe <EmptynessInside>(RightDown, "RightFlipperDown");
     signalBus.Unsubscribe <EmptynessInside>(RightUp, "RightFlipperUp");
 }
Пример #5
0
 public void Dispose()
 {
     _signalBus.Unsubscribe <UnitLatestDSUpdateEvt>(OnUnitLatestDSUpdate);
     _signalBus.Unsubscribe <UnitOriginPointEvt>(OnUnitOriginPointEvt);
     _signalBus.Unsubscribe <UnitTerminusPointEvt>(OnUnitTerminusPointEvt);
     _signalBus.Unsubscribe <UnitLineImgUpdateEvt>(OnUnitLineImgUpdateEvt);
 }
Пример #6
0
 public void Dispose()
 {
     _signalBus.Unsubscribe <FleetDestroyedSignal>(HandleFleetDestroyed);
     _signalBus.Unsubscribe <PlayerLivesDepletedSignal>(HandleLivesDepleted);
     _signalBus.Unsubscribe <EnemyDetectedSignal>(HandleEnemyDetected);
     _signalBus.Unsubscribe <NameEnteredSignal>(HandleNameEntered);
 }
        public override void PreExitAction(IState currentState)
        {
            _signalBus.Unsubscribe <GameplayScoreChangedSignal>(HandleGameplayScoreChanged);
            _signalBus.Unsubscribe <GameplayCurrentWaveChangedSignal>(HandleGameplayWavesChanged);

            base.PreExitAction(currentState);
        }
Пример #8
0
 public void Dispose()
 {
     _signalBus.Unsubscribe <UrlsUpdateEvt>(OnUrlsUpdateEvt);
     _signalBus.Unsubscribe <UnitLatestDSUpdateEvt>(OnUnitLatestDSUpdate);
     _signalBus.Unsubscribe <RegionsDownloaded>(OnRegionsDownloaded);
     _signalBus.Fire <ImgUploadRevokePermissionEvt>();// disable JS img btn
 }
Пример #9
0
    public void Dispose()
    {
        _signalBus.Unsubscribe <ImgUploadPermissionEvt>(OnImgUploadPermission);
        _signalBus.Unsubscribe <ImgUploadRevokePermissionEvt>(OnImgUploadRevokePermissionEvt);

        _signalBus.Unsubscribe <QueryTextureEvt>(OnQueryTextureEvt);
        _signalBus.Unsubscribe <HomeInitEvt>(OnHomeInit);
    }
        private void OnDisable()
        {
            signalBus.Unsubscribe <Match3Signals.GemCreatedSignal>(OnGemCreated);
            signalBus.Unsubscribe <Match3Signals.GemDestroyedSignal>(OnGemDestroyed);
            signalBus.Unsubscribe <Match3Signals.OnBoardCreatedSignal>(OnBoardCreated);
            signalBus.Unsubscribe <Match3Signals.OnPlayerTurnStart>(OnTurnStarts);
            signalBus.Unsubscribe <Match3Signals.StartFallSignal>(OnTurnEnds);

            Dispose();
        }
Пример #11
0
    public void Dispose()
    {
        _gameDataHandler.SaveGameData(Data);

        _signalBus.Unsubscribe <StartedAwaitingSignal>(OnStartedAwaiting);
        _signalBus.Unsubscribe <StartedGameSignal>(OnStartedGame);
        _signalBus.Unsubscribe <PlayerDiedSignal>(OnPlayerDied);
        _signalBus.Unsubscribe <PickedUpCollectableSignal>(OnPickedUp);
        _disposable.Dispose();
    }
Пример #12
0
        public void Dispose()
        {
            PlayerPrefs.SetInt("highscore", HighScore);
            PlayerPrefs.SetInt("lastscore", LastScore);

            signalBus.Unsubscribe <GameOverSignal>(GameOver);
            signalBus.Unsubscribe <StackSignal>(IncreaseScore);
            signalBus.Unsubscribe <PerfectStackSignal>(IncreaseScore);
            controls.Main.Stack.performed -= StartGame;
            controls.Main.Stack.Disable();
        }
Пример #13
0
 private void OnDestroy()
 {
     SignalBus.Unsubscribe <SimulationCreatedSignal>(OnSimulationCreated);
     SignalBus.Unsubscribe <SimulationStartedSignal>(OnSimulationStarted);
     SignalBus.Unsubscribe <SimulationLoadedSignal>(OnSimulationLoaded);
     SignalBus.Unsubscribe <SimulationEndedSignal>(OnSimulationEnded);
 }
Пример #14
0
        private void Update()
        {
            if (Input.GetKeyDown(KeyCode.Q))
            {
                Debug.Log("Subscribe OnBrickDestroyed");
                SignalBus.Subscribe <BrickDestructedSignal>(OnBrickDestroyed);
            }

            if (Input.GetKeyDown(KeyCode.W))
            {
                Debug.Log("Unsubscribe OnBrickDestroyed");
                SignalBus.Unsubscribe <BrickDestructedSignal>(OnBrickDestroyed);
            }

            if (Input.GetKeyDown(KeyCode.E))
            {
                Debug.Log("Fire OnBrickDestroyed");
                SignalBus.Fire(new BrickDestructedSignal(null));
            }

            if (Input.GetKeyDown(KeyCode.R))
            {
                _simulationController.End();
            }
        }
Пример #15
0
 private void OnDestroy()
 {
     Time.timeScale = 1f;
     signalBus.Unsubscribe <PlayerDiedSignal>(OnPlayerDied);
     mainMenuButton.onClick.RemoveListener(OnMainButtonClicked);
     addHighScoreButton.onClick.RemoveListener(OnNewHighScoreClicked);
 }
Пример #16
0
 private void OnDestroy()
 {
     _views.Clear();
     SignalBus.Unsubscribe <GameStartedSignal>(OnGameStarted);
     SignalBus.Unsubscribe <BallSpawnSignal>(OnBallSpawn);
     SignalBus.Unsubscribe <BallDespawnSignal>(OnBallDespawn);
     SignalBus.Unsubscribe <MatchStopSignal>(OnMatchStop);
 }
Пример #17
0
 public void Dispose()
 {
     _signalBus.Unsubscribe <MainSceneOpenSignal>(OnMainSceneOpen);
     _signalBus.Unsubscribe <LoadSceneOpenSignal>(OnLoadSceneOpen);
     _signalBus.Unsubscribe <SettingsSceneOpenSignal>(OnSettingsSceneOpen);
     _signalBus.Unsubscribe <SelectionSceneOpenSignal>(OnSelectionSceneOpen);
     _signalBus.Unsubscribe <StartSceneOpenSignal>(OnStartSceneOpen);
     _signalBus.Unsubscribe <SearchSceneOpenSignal>(OnSearchSceneOpen);
     _signalBus.Unsubscribe <ResultSceneOpenSignal>(OnResultSceneOpen);
     _signalBus.Unsubscribe <BackButtonPressedSignal>(OnBackButtonPressed);
 }
Пример #18
0
        // ReSharper disable once InvertIf
        private void OnReceived(TSignal signal)
        {
            Subject.OnNext(signal);

            if (signal.IsTerminator)
            {
                SignalBus.Unsubscribe <TSignal>(OnReceived);
                Subject.OnCompleted();
            }
        }
Пример #19
0
 private bool CheckOnEnd()
 {
     if (CurrentCheckpoint < CheckpointsCount)
     {
         return(false);
     }
     SignalBus.Fire(new GameModeEndSignal(true));
     SignalBus.Unsubscribe <RunnerTouchCheckpointSignal>(OnRunnerTouchCheckpoint);
     return(true);
 }
        public virtual void Dispose()
        {
            SignalBus.Unsubscribe <RequestStateChangeSignal>(GoToState);

            CurrentStateBehaviour?.OnStateExit();

            Disposables.Dispose();

            StateBehaviours.Clear();
        }
Пример #21
0
        public override void PostExit()
        {
            _signalBus.Unsubscribe <IGameplayFinishedSignal>(HandleGameplayFinished);

            _gameplayScore.OnScoreChanged       -= OnGameplayScoreChanged;
            _gameplayScore.OnCurrentWaveChanged -= OnCurrentWaveChanged;

            _gameplayScore = null;

            base.PostExit();
        }
Пример #22
0
 protected virtual void OnDestroy()
 {
     if (EncounterSelectedListener != null)
     {
         EncounterSelectedListener.Selected -= EncounterSelected;
     }
     if (SignalBus != null)
     {
         SignalBus.Unsubscribe <EncounterLocksUpdatedSignal>(UpdateEncounterLocks);
     }
 }
        private bool CheckOnEnd()
        {
            if (RunnerLives > 0)
            {
                return(false);
            }

            SignalBus.Fire(new GameModeEndSignal(false));
            SignalBus.Unsubscribe <RunnerDiedSignal>(OnRunnerDied);
            return(true);
        }
        public override void PostExitAction(IState currentState)
        {
            base.PostExitAction(currentState);
            _signalBus.Unsubscribe <HighScoresDatabaseFetchedSignal>(HandleHighScoresDatabaseFetched);

            var highScoreItemsCount = _highScoreItems.Count;

            for (int i = 0; i < highScoreItemsCount; i++)
            {
                _highScoresItemViewPool.Despawn(_highScoreItems[i]);
            }
            _highScoreItems.Clear();
        }
        public static UniTask <T> WaitForSignal <T>(this SignalBus signalBus)
        {
            var source = AutoResetUniTaskCompletionSource <T> .Create();

            signalBus.Subscribe <T>(Received);
            return(source.Task);

            void Received(T t)
            {
                signalBus.Unsubscribe <T>(Received);
                source.TrySetResult(t);
            }
        }
Пример #26
0
        public IEnumerable Unsubscribe_WhenSignalFiredAfterUnsubscribe_CallbackIsNotExecuted()
        {
            SignalBus bus           = new SignalBus();
            int       callbackCount = 0;

            void OnSignalFired(TestSignal signal)
            {
                callbackCount++;
            }

            bus.Subscribe <TestSignal>(OnSignalFired);
            bus.Unsubscribe <TestSignal>(OnSignalFired);

            bus.Fire(new TestSignal());

            Assert.IsTrue(callbackCount == 0);

            yield return(null);
        }
 public void Dispose()
 {
     _signalBus.Unsubscribe(_signalType, OnSignalFired, _identifier);
 }
Пример #28
0
 public void Dispose()
 {
     _sessionModel.State.Unsubscribe(HandleEnterCombatState);
     _signalBus.Unsubscribe <EnemyShipDestroyedSignal>(HandleEnemyShipDestroyed);
 }
Пример #29
0
 public void Dispose()
 {
     _signalBus.Unsubscribe <HomeInitEvt>(OnInit);
 }
Пример #30
0
        public override void Dispose()
        {
            base.Dispose();

            SignalBus.Unsubscribe <OpenPopupSignal>(Execute);
        }