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;
    }
Esempio n. 2
0
 // 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;
     }
 }