Example #1
0
        private void OnGameStarted()
        {
            currentLevel        = 0;
            currentBalance      = balance[currentLevel];
            enemiesDeadCount    = 0;
            enemiesSpawnedCount = 0;
            if (routine != null)
            {
                StopCoroutine(routine);
            }

            routine = StartCoroutine(GameFlowCoroutine());
        }
        private void CheckLevel()
        {
            if (enemiesDeadCount >= currentBalance.totalEnemies)
            {
                enemiesDeadCount = 0;
                enemiesSpawnedCount = 0;
                currentLevel += 1;

                int targetBalance = currentLevel;
                if (targetBalance > balance.Length)
                    targetBalance = balance.Length;

                currentBalance = balance[targetBalance];
            }
        }
Example #3
0
        private void CheckLevel()
        {
            if (enemiesDeadCount >= currentBalance.totalEnemies)
            {
                enemiesDeadCount    = 0;
                enemiesSpawnedCount = 0;
                currentLevel       += 1;

                int targetBalance = currentLevel;
                if (targetBalance > balance.Length)
                {
                    targetBalance = balance.Length;
                }

                currentBalance = balance[targetBalance];
            }
        }
        private void OnGameStarted()
        {
            currentLevel = 0;
            currentBalance = balance[currentLevel];
            enemiesDeadCount = 0;
            enemiesSpawnedCount = 0;
            if (routine!=null)
                StopCoroutine(routine);

            routine = StartCoroutine(GameFlowCoroutine());
        }