public void EndGame() { //Set pause PauseGame(); GameUIManager.Instance.GameOver(CoinsCount, Score); //save coins ad score DataHolder.AddCoinsCount(CoinsCount); if (score > DataHolder.GetMaxScore()) { DataHolder.SetMaxScore((int)score); } }
public void RestartGame() { //Set coins and score to zero DataHolder.AddCoinsCount(CoinsCount); coinsCount = 0; score = 0f; Start(); //Set initial values TimeManager.Instance.TimeCount = SettingsManager.Instance.startTimeCount; player.speed = SettingsManager.Instance.startPlayerSpeed; SectionManager.Instance.Restart(); }