Esempio n. 1
0
        public override void PostExit()
        {
            _signalBus.Unsubscribe <IGameplayFinishedSignal>(HandleGameplayFinished);

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

            _gameplayScore = null;

            base.PostExit();
        }
Esempio n. 2
0
        public override async UniTask OnEnter()
        {
            _signalBus.Subscribe <IGameplayFinishedSignal>(HandleGameplayFinished);

            _gameplayScore = new GameplayScore();
            _gameplayScore.OnScoreChanged       += OnGameplayScoreChanged;
            _gameplayScore.OnCurrentWaveChanged += OnCurrentWaveChanged;

            await base.OnEnter();

            OnGameplayScoreChanged(_gameplayScore.Score);
            OnCurrentWaveChanged(_gameplayScore.CurrentWave);
        }