public void ChangeEnemyDestoyed() { kEnemiew += 1; currentEnemies = eToWin - kEnemiew; View.SetKilledEnemies(currentEnemies); if (kEnemiew == eToWin) { Level += 1; ChangeLevel(); //PlayerPrefs.SetInt("IsFirstRun", 0); View.ChangeGameOverText("Victory!"); if (Level == 3) { View.ChangeButtonText("Retry"); } else { View.ChangeButtonText("Next level"); } if (Level == 2 && unlockedLevels < 2) { unlockedLevels = 2; } else if (Level == 3 && unlockedLevels < 3) { unlockedLevels = 3; } GameManager.instance.GameOver(); } }