void Start()
    {
        // use anonymous delegates for this simple example for gathering data from GameCenter. In production you would want to
        // add and remove your event listeners in OnEnable/OnDisable!
        GameCenterManager.categoriesLoaded += delegate(List <GameCenterLeaderboard> leaderboards)
        {
            _leaderboards       = leaderboards;
            _hasLeaderboardData = _leaderboards != null && _leaderboards.Count > 0;
        };

        GameCenterManager.achievementMetadataLoaded += delegate(List <GameCenterAchievementMetadata> achievementMetadata)
        {
            _achievementMetadata = achievementMetadata;
            _hasAchievementData  = _achievementMetadata != null && _achievementMetadata.Count > 0;
        };

        // after authenticating grab the players profile image
        GameCenterManager.playerAuthenticated += () =>
        {
            GameCenterBinding.loadProfilePhotoForLocalPlayer();
            loadFriends();
        };

        // always authenticate at every launch
        GameCenterBinding.authenticateLocalPlayer();
    }
    void playerAuthenticated()
    {
        Debug.Log("playerAuthenticated");

        GameCenterBinding.loadProfilePhotoForLocalPlayer();

        GameCenterBinding.retrieveFriends(true, false);
    }
Example #3
0
    void Start()
    {
        // use anonymous delegates for this simple example for gathering data from GameCenter. In production you would want to
        // add and remove your event listeners in OnEnable/OnDisable
        GameCenterManager.categoriesLoaded += delegate(List <GameCenterLeaderboard> leaderboards)
        {
            this.leaderboards = leaderboards;
        };

        GameCenterManager.achievementMetadataLoaded += delegate(List <GameCenterAchievementMetadata> achievementMetadata)
        {
            this.achievementMetadata = achievementMetadata;
        };

        // after authenticating grab the players profile image
        GameCenterManager.playerAuthenticated += () =>
        {
            GameCenterBinding.loadProfilePhotoForLocalPlayer();
        };
    }
Example #4
0
 // Starts the loading of the profile image for the currently logged in player
 public void LoadPlayerProfilePic()
 {
     GameCenterBinding.loadProfilePhotoForLocalPlayer();
 }