/* Setting & submitting score to global scoring system "Parse" * A dll handles the request coming to and from the global scores cloud storage */ public static void ClaimScore() { string playerName = null; int playerScore = 0; if (!scoreSubmitted) { try{ playerName = PlayerPrefs.GetString("Player Name"); playerScore = PlayerPrefs.GetInt("Player Score"); if (playerName.Equals("") || playerName == null) { playerName = "Anonymous"; } HighScoresWindows.AddNewHighscore(playerName, playerScore); print("Player " + playerName + " Score Saved!"); } catch (Exception error) { print("Error: " + error); } } }
public void Start() { for (int i = 0; i < highscoreFields.Length; i++) { highscoreFields[i].text = i + 1 + ". Fetching..."; } highscoresManager = GetComponent<HighScoresWindows>(); StartCoroutine("RefreshHighscores"); }
void Start() { for (int i = 0; i < highscoreFields.Length; i++) { highscoreFields[i].text = i + 1 + ". Fetching..."; } highscoresManager = GetComponent <HighScoresWindows>(); StartCoroutine("RefreshHighscores"); }
void Awake() { instance = this; }