public void UpdateLevel() { if (CScore.GetScore() >= Level[iLevel].iGoal) { if (isEnd) // 終了 { CPauser.Pause(); CScore.AddFScore(); CScore.AddFScore(); CScore.AddFScore(); CSceneManager CSM = GameObject.Find("FadeCanvas").GetComponent <CSceneManager>(); CSM.OnChangeScene_Result(); } else { // 現在時間取得 float endtime = gTimer.GetComponent <CNumberManager>().Get_fTime(); // ステージクリア時間算出 float totaltime = endtime - fStartTime; int timelimit = Level[iLevel].iMinutes * 60 + Level[iLevel].iSeconds; Level[iLevel].fTotalTime = totaltime; if (totaltime > timelimit || iLevel >= 5) // 制限時間内にクリアしなかったら次のステージで終了 { isEnd = true; } // スタート時間更新 fStartTime = endtime; iLevel++; gScore.GetComponent <CScore>().Set_iScoreParam(Level[iLevel].iGoal); CObjectManager.Instance.Create(Level[iLevel].iObjectNum - Level[iLevel - 1].iObjectNum); } } }
IEnumerator CountDownToStart() { CPauser.Pause(); while (iCountDownTime > 0) { CountDownDisplay.text = iCountDownTime.ToString(); yield return(new WaitForSeconds(1f)); iCountDownTime--; } CountDownDisplay.text = "GO!"; yield return(new WaitForSeconds(1f)); CountDownDisplay.gameObject.SetActive(false); Debug.Log("解除"); CPauser.Resume(); }