public override void PostExit() { _signalBus.Unsubscribe <IGameplayFinishedSignal>(HandleGameplayFinished); _gameplayScore.OnScoreChanged -= OnGameplayScoreChanged; _gameplayScore.OnCurrentWaveChanged -= OnCurrentWaveChanged; _gameplayScore = null; base.PostExit(); }
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); }