private void Start() { SetUpGamePlayButtons(); timerObserver.IsCountdownOver() .Where(isOver => isOver) .Subscribe(_ => OnGameOver(gameOverSpiel_TimesUp)) .AddTo(this); playerStats.IsGameOver() .Where(isGameOver => isGameOver) .Subscribe(_ => OnGameOver(gameOverSpiel_Normal)) .AddTo(this); dialogueObserver.IsDialogueDone() .Subscribe(isDone => { if (isDone) { hudPanel.FireEvent(); timerSetter.StartCountdown(); } else { hudPanel.CancelNow(); timerSetter.PauseCountdown(); } }) .AddTo(this); SetUIStartingState(); }
private IEnumerator CorFirePlayableClose() { if (playableClose == null) { yield return(null); } else { playableClose.gameObject.SetActive(true); playableClose.Play(); yield return(new WaitForSeconds((float)playableClose.duration)); playableClose.gameObject.SetActive(false); } panel.gameObject.SetActive(false); if (shouldFreezeGamePlay) { timerSetter.StartCountdown(); playerInput.EnableControls(); } if (afterEvent != null) { afterEvent.FireEvent(); } }
private void OnGameOver(string displayString) { gameOverText.text = displayString; gameOverPanel.FireEvent(); hudPanel.CancelNow(); }