IEnumerator doLogin(LeaderboardAPI api) { bool success = false; yield return(api.logInPlayer("james", "password1", () => { Debug.Log("Success! We logged in as james."); success = true; }, logFailure)); if (!success) { yield break; } yield return(api.submitScore(6000, LeaderboardAPI.MatchType.OneMinuteAR, () => { Debug.Log("Score submitted successfully."); }, logFailure)); yield return(api.getLeaderboard(0, (scores) => { foreach (LeaderboardAPI.LeaderboardScore score in scores) { Debug.Log("Retrieved a new score: " + score.score + " for match type " + score.type.ToString()); } }, logFailure)); }
void SubmitScore() { LeaderboardAPI.RecordScore(leaderboardId, "Brad Keys", System.Convert.ToInt32(GameManager.player.score.val), OnScoreRecorded); }
void SubmitScore() { LeaderboardAPI.RecordScore(leaderboardId, userName, System.Convert.ToInt32(score), OnScoreRecorded); }
// Use this for initialization void Start() { PlayerPrefs.DeleteAll(); api = FindObjectOfType <LeaderboardAPI> (); StartCoroutine(doLogin(api)); }