コード例 #1
0
ファイル: StageMgr.cs プロジェクト: gkongs/portfolio_android
 // 시작 -> 어느정도 거리를 이동한다 -> 적을 조우한다 -> 공격한다 -> 적을 모두 잡거나 죽는다 -> 반복
 IEnumerator RoundProcess()
 {
     while (curLevel.round != lastRound)
     {
         //text 변경
         text.text = $"{curLevel.stage + 1} - {curLevel.round}";
         // round start
         while (NextRoundDist > 0)
         {
             NextRoundDist = NextRoundDist - characterMgr.OverallSpeed;
             // 배경 무브
             stage[curLevel.stage].background.GetComponent <RectTransform>().anchoredPosition -= moveBackgroundVal;
             yield return(null);
         }
         ChangeBackgroundPos();
         // spawn enemies
         SpawnEnemies();
         //characters attack
         characterMgr.AttackAllCharacters();
         //round end
         while (true)
         {
             if (characterMgr.DieAllCharacters())
             {
                 RoundSetting(0);
                 break;
             }
             else if (enemyMgr.DieAllEnemies())
             {
                 RoundSetting(1);
                 break;
             }
             else
             {
                 yield return(roundEndCheckDelay);
             }
         }
     }
     StageSetting();
 }