public static void EndGame() { if (instance.gameState == _GameState.Over) { return; } instance.playerWon = instance.life > 0; instance.gameState = _GameState.Over; if (instance.playerWon) { RscManager.GainRsc(instance.rscGainOnWin); PerkManager.GainRsc(instance.perkRscGainOnWin); RscManager.CachedRsc(); //for rsc to be carry forth to next level PerkManager.CachedProgress(); //for perk progress to be carry forth to next level AudioManager.OnPlayerWon(); } else { AudioManager.OnPlayerLost(); } Debug.Log("Game Over " + instance.playerWon + " " + instance.gameState); TDTK.OnGameOver(instance.playerWon); }