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]; } }
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()); }