// 광고보고 난후 이어하기 루틴. IEnumerator Continue() { while (_bContinue) { if (WaitTime()) { switch (_ContinueStep) { case CONTINUE_STEP.ADDTIME: { _Timer.AddTime(15.0f); _ContinueStep = CONTINUE_STEP.START; WaitTimeReset(0.5f); } break; case CONTINUE_STEP.START: { _bContinue = false; _bGaemReady = true; _StartStep = START_STEP.SIZE; StartCoroutine(StartGame()); } break; } } yield return(new WaitForFixedUpdate()); } }
// 다음 스테이지 루틴. IEnumerator NextGame() { while (_bNextReady) { if (WaitTime()) { switch (_NextStep) { case NEXT_STEP.ADDTIME: { float stageSpendTime = _Timer.GetStageSpendTime(); if (stageSpendTime <= _CurMapData.iBonusTerms) { _Timer.AddTime(_CurMapData.iBonusTime); WaitTimeReset(1.0f); } _NextStep = NEXT_STEP.NEXT; } break; case NEXT_STEP.NEXT: { _iStage++; _UIStage.text = string.Format("{0} {1}", _sStage, _iStage + 1); _bNextReady = false; _bGaemReady = true; _StartStep = START_STEP.SIZE; WaitTimeReset(0.0f); StartCoroutine(StartGame()); SetClear(false); } break; } } yield return(new WaitForFixedUpdate()); } }
// 초기화. void Init() { _iStage = 0; _UIStage.text = string.Format("{0} {1}", _sStage, _iStage + 1); _iStageScore = 0; _iTotalScore = 0; _iCurScore = 0; #if !UNITY_EDITOR if (GameService._Instance.IsConnected()) { _lBestScore = GameService._Instance.GetBestScore(); } else { _lBestScore = PlayerPrefs.GetInt("BestScore", 0); } #else _lBestScore = PlayerPrefs.GetInt("BestScore", 0); #endif _BoxMapManager.ClearBoxMap(); _BoxMapManager.Init(); _TouchManager.Init(); SetScore(0); SetBest(_lBestScore); _Step = STEP.START; _StartStep = START_STEP.SIZE; SetClear(false); SetOriginCount(2); _iADContinue = 1; }
// 게임 시작 루틴. IEnumerator StartGame() { while (_bGaemReady) { if (WaitTime()) { switch (_StartStep) { case START_STEP.INIT: Init(); break; case START_STEP.SIZE: { if (_iStage < _listMapData.Count) { _CurMapData = _listMapData[_iStage]; } StartCoroutine(_BoxMapManager.SetBoxMap(_CurMapData)); _StartStep = START_STEP.COLOR; WaitTimeReset(1.0f); } break; case START_STEP.COLOR: { _BoxMapManager.BoxColoring(); _StartStep = START_STEP.COUNT; WaitTimeReset(1.0f); } break; case START_STEP.COUNT: { _Timer.BlinkStart(); _StartStep = START_STEP.SHUFFLE; WaitTimeReset(3.0f); } break; case START_STEP.SHUFFLE: { StartCoroutine(_BoxMapManager.BoxShuffling()); _StartStep = START_STEP.PLAY; WaitTimeReset(0.7f); } break; case START_STEP.PLAY: Play(); break; } } yield return(new WaitForFixedUpdate()); } }