Beispiel #1
0
    IEnumerator signInAsUsername(string username)
    {
        yield return(api.signOutPlayer(null, null));

        yield return(api.registerPlayer(username, "*****@*****.**", api.DeviceIdentifier, api.DeviceIdentifier, null, null));

        yield return(api.logInPlayer(username, api.DeviceIdentifier, null, showUsernameErrorDialog));
    }
Beispiel #2
0
    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));
    }