IEnumerator playUpdate() { //set the timer; float gameTimer = this._gameTime; while (gameTimer > 0 && !this._isFinish) { gameTimer -= Time.deltaTime; this._timerBar.fillAmount = gameTimer / this._gameTime; yield return(null); } yield return(StartCoroutine(this._uiCtrl.hidePlayUI())); yield return(StartCoroutine(this._uiCtrl.hidePlayTipUI())); //gane over if (this.onGameOver != null) { this.onGameOver(); } //finish or not? if (this._isFinish) { SeeionDataCtrl.setGamTime(this._gameTime - gameTimer); yield return(StartCoroutine(endPhase())); } else { yield return(StartCoroutine(overPhase())); } }
IEnumerator playPhase() { //reset Game Data SeeionDataCtrl.restart(); this._reticle.Hide(); // this._hctrl.enabled = true; yield return(StartCoroutine(this._uiCtrl.showPlayUI())); yield return(StartCoroutine(this._uiCtrl.showPlayTipUI())); yield return(StartCoroutine(this.playUpdate())); }
IEnumerator Start() { SeeionDataCtrl.SetGameType(_gameType); yield return(StartCoroutine(startPhase())); }