Beispiel #1
0
 public void OpenOptionsMenu()
 {
     if (PlayGamesScript.IsAuthenticated())
     {
         signedInImage.color = Color.green;
         signedInText.text   = "Sign out";
     }
     else
     {
         signedInImage.color = Color.red;
         signedInText.text   = "Sign in";
     }
 }
Beispiel #2
0
 void Start()
 {
     if (PlayerPrefs.HasKey("bestScore"))
     {
         int best = PlayerPrefs.GetInt("bestScore");
         if (best > 1)
         {
             bestScoreText.text = $"Best     <b>{best}";
         }
     }
     else if (PlayGamesScript.IsAuthenticated())
     {
         long best = PlayGamesScript.LoadScoreFromLeaderboard();
         if (best > 1)
         {
             bestScoreText.text = $"Best     <b>{best}";
             PlayerPrefs.SetInt("bestScore", (int)best);
         }
     }
 }