Esempio n. 1
0
 private void GameOver()
 {
     showAd = true;
     GameOverPanel.SetActive(true);
     powerPanel.SetActive(false);
     ProtectedPrefs.SetInt("Coins", lcoin + coin);
     goCoin.text  = "Coins: " + coin.ToString();
     goScore.text = "Score: " + Controller.Distance.ToString("f0") + "0";
     if (Controller.Distance > ProtectedPrefs.GetFloat("HighScore"))
     {
         ProtectedPrefs.SetFloat("HighScore", Controller.Distance);
     }
     if (ProtectedPrefs.HasKey("HighScore"))
     {
         goBScore.text = "Best Score: " + ProtectedPrefs.GetFloat("HighScore").ToString("f0") + "0";
     }
     else
     {
         goBScore.text = "Best Score: " + Controller.Distance.ToString("f0") + "0";
     }
     if (FB.IsLoggedIn)
     {
         #if !UNITY_EDITOR
         StartCoroutine(Facebook.Unity.FBManager.SetScore());
         #endif
     }
 }