Ejemplo n.º 1
0
    public void OpenDeathMenu()
    {
        Time.timeScale = 0f;
        if (score > highScore)
        {
            highScore = score;
            PlayerPrefs.SetFloat("HighScore", (int)highScore);
            _firebaseSetup.WriteUserToDatabase(PlayerPrefs.GetString("Username"), (int)highScore);
        }


        pauseButton.SetActive(false);
        deathMenu.SetActive(true);
        highScoreText.text = "High Score: " + (int)highScore;
    }
Ejemplo n.º 2
0
 public void OnRegister()
 {
     if (usernameInput.text.Equals(""))
     {
         warningText.SetText("You must have a name!");
     }
     else if (isTaken())
     {
         warningText.SetText("Damn! Someone already has that name.");
     }
     else
     {
         _firebaseSetup.WriteUserToDatabase(usernameInput.text.ToUpper(), 0);
         PlayerPrefs.SetString("Username", usernameInput.text.ToUpper());
         GoToMainMenuScene();
     }
 }