public void EndGame() { pauseButton.SetInteractable(false); gameOverScreen.SetActive(true); int pointsEarned = pointsSystem.GetCurrentPoints(); int currentLevel = PlayerPrefs.GetInt(PrefKeys.playerLevel); int currentExp = PlayerPrefs.GetInt(PrefKeys.playerExp);; levelUpAnimator.LevelUpAnimation(currentLevel, currentExp, pointsSystem.GetCurrentPoints()); UpdatePlayerExp(pointsEarned); int bestScore = PlayerPrefs.GetInt(PrefKeys.bestScore); if (bestScore < pointsEarned) { upd.SetPlayerHighScore(pointsEarned); } isGamePaused = true; }
// Update is called once per frame void Update() { try{ if (ps.GetCurrentPoints() == pointsNeeded[currentIndex]) { Vector3 moveTo = new Vector3(tutorials[currentIndex].position.x, Camera.main.transform.position.y, Camera.main.transform.position.z); camerasSpring.StartMove(moveTo); currentIndex += 1; } }catch { currentIndex = 0; } }