private void onAuthenticateLocalPlayer(string array)
    {
        string[] data;
        data = array.Split("," [0]);

        _player = new GameCenterPlayerTemplate(data[0], data [1], data [2]);

        _IsPlayerAuthed = true;
        dispatcher.dispatch(GAME_CENTER_PLAYER_AUTHENTICATED);
    }
Esempio n. 2
0
    private void onAuthenticateLocalPlayer(string array)
    {
        string[] data;
        data = array.Split("," [0]);

        _player = new GameCenterPlayerTemplate(data[0], data [1], data [2]);


        ISN_CacheManager.SendAchievmentChashedRequests();

        _IsPlayerAuthed = true;


        ISN_Result result = new ISN_Result(_IsPlayerAuthed);

        OnAuthFinished(result);
        dispatcher.dispatch(GAME_CENTER_PLAYER_AUTHENTICATED, result);
    }
Esempio n. 3
0
    private void onUserInfoLoaded(string array)
    {
        string[] data;
        data = array.Split("," [0]);

        string playerId    = data[0];
        string displayName = data[3];
        string alias       = data[2];
        string avatar      = data[1];

        GameCenterPlayerTemplate p = new GameCenterPlayerTemplate(playerId, displayName, alias);

        p.SetAvatar(avatar);


        if (_players.ContainsKey(playerId))
        {
            _players[playerId] = p;
        }
        else
        {
            _players.Add(playerId, p);
        }

        if (p.playerId == _player.playerId)
        {
            _player = p;
        }



        ISN_UserInfoLoadResult result = new ISN_UserInfoLoadResult(p);

        OnUserInfoLoaded(result);
        dispatcher.dispatch(GAME_CENTER_USER_INFO_LOADED, result);
    }
    private void onUserInfoLoaded(string array)
    {
        string[] data;
        data = array.Split("," [0]);

        string playerId    = data[0];
        string displayName = data[3];
        string alias       = data[2];
        string avatar      = data[1];

        GameCenterPlayerTemplate p = new GameCenterPlayerTemplate(playerId, displayName, alias);

        p.SetAvatar(avatar);

        _players.Add(playerId, p);
        if (p.playerId == _player.playerId)
        {
            _player = p;
        }



        dispatcher.dispatch(GAME_CENTER_USER_INFO_LOADED);
    }
Esempio n. 5
0
	private void onUserInfoLoaded(string array) {

		string[] data;
		data = array.Split("," [0]);

		string playerId = data[0];
		string displayName = data[3];
		string alias = data[2];
		string avatar = data[1];

		GameCenterPlayerTemplate p =  new GameCenterPlayerTemplate(playerId, displayName, alias);
		p.SetAvatar(avatar);


		if(_players.ContainsKey(playerId)) {
			_players[playerId] = p;
		} else {
			_players.Add(playerId, p);
		}

		if(p.PlayerId == _player.PlayerId) {
			_player = p;
		}




		ISN_UserInfoLoadResult result = new ISN_UserInfoLoadResult (p);
		OnUserInfoLoaded (result);
		Dispatcher.dispatch (GAME_CENTER_USER_INFO_LOADED, result);
		

	}    
Esempio n. 6
0
	private void onAuthenticateLocalPlayer(string  array) {
		string[] data;
		data = array.Split("," [0]);

		_player = new GameCenterPlayerTemplate (data[0], data [1], data [2]);


		ISN_CacheManager.SendAchievementCachedRequest();

		_IsPlayerAuthenticated = true;


		ISN_Result result = new ISN_Result (_IsPlayerAuthenticated);
		OnAuthFinished (result);
		Dispatcher.dispatch (GAME_CENTER_PLAYER_AUTHENTICATED, result);



	}
Esempio n. 7
0
 public ISN_UserInfoLoadResult(GameCenterPlayerTemplate tpl) : base(true)
 {
     _tpl = tpl;
 }
Esempio n. 8
0
    private void onUserInfoLoaded(string array)
    {
        string[] data;
        data = array.Split("," [0]);

        string playerId = data[0];
        string displayName = data[3];
        string alias = data[2];
        string avatar = data[1];

        GameCenterPlayerTemplate p =  new GameCenterPlayerTemplate(playerId, displayName, alias);
        p.SetAvatar(avatar);

        _players.Add(playerId, p);
        if(p.playerId == _player.playerId) {
            _player = p;
        }

        dispatcher.dispatch (GAME_CENTER_USER_INFO_LOADED);
    }
Esempio n. 9
0
    private void onAuthenticateLocalPlayer(string  array)
    {
        string[] data;
        data = array.Split("," [0]);

        _player = new GameCenterPlayerTemplate (data[0], data [1], data [2]);

        _IsPlayerAuthed = true;
        dispatcher.dispatch (GAME_CENTER_PLAYER_AUTHENTICATED);
    }
Esempio n. 10
0
    void OnGUI()
    {
        GUI.Label(new Rect(10, 20, 400, 40), "Friend List Load Example", headerStyle);

        if (GUI.Button(new Rect(300, 10, 150, 50), "Load Friends"))
        {
            GameCenterManager.RetrieveFriends();
        }


        if (!renderFriendsList)
        {
            return;
        }

        if (GUI.Button(new Rect(500, 10, 180, 50), "Leaberboard Chalange All"))
        {
            GameCenterManager.issueLeaderboardChallenge(ChalangeLeadeboard, "Your message here", GameCenterManager.friendsList.ToArray());
        }


        if (GUI.Button(new Rect(730, 10, 180, 50), "Achievement Chalange All"))
        {
            GameCenterManager.issueAchievementChallenge(ChalangeAchivment, "Your message here", GameCenterManager.friendsList.ToArray());
        }


        GUI.Label(new Rect(10, 90, 100, 40), "id", boardStyle);
        GUI.Label(new Rect(150, 90, 100, 40), "name", boardStyle);;
        GUI.Label(new Rect(300, 90, 100, 40), "avatar ", boardStyle);

        int i = 1;

        foreach (string FriendId in GameCenterManager.friendsList)
        {
            GameCenterPlayerTemplate player = GameCenterManager.GetPlayerById(FriendId);
            if (player != null)
            {
                GUI.Label(new Rect(10, 90 + 70 * i, 100, 40), player.playerId, boardStyle);
                GUI.Label(new Rect(150, 90 + 70 * i, 100, 40), player.alias, boardStyle);
                if (player.avatar != null)
                {
                    GUI.DrawTexture(new Rect(300, 75 + 70 * i, 50, 50), player.avatar);
                }
                else
                {
                    GUI.Label(new Rect(300, 90 + 70 * i, 100, 40), "no photo ", boardStyle);
                }

                if (GUI.Button(new Rect(450, 90 + 70 * i, 150, 30), "Chalange Leaberboard"))
                {
                    GameCenterManager.issueLeaderboardChallenge(ChalangeLeadeboard, "Your message here", FriendId);
                }

                if (GUI.Button(new Rect(650, 90 + 70 * i, 150, 30), "Chalange Achievement"))
                {
                    GameCenterManager.issueAchievementChallenge(ChalangeAchivment, "Your message here", FriendId);
                }


                i++;
            }
        }
    }
	//--------------------------------------
	// init
	//--------------------------------------

	public GameServicePlayerTemplate(GameCenterPlayerTemplate gc, GooglePlayerTemplate ps) {
		gc_player = gc;
		ps_player = ps;

	}
Esempio n. 12
0
    //--------------------------------------
    // init
    //--------------------------------------

    public GameServicePlayerTemplate(GameCenterPlayerTemplate gc, GooglePlayerTemplate ps)
    {
        gc_player = gc;
        ps_player = ps;
    }
Esempio n. 13
0
    void OnGUI()
    {
        GUI.Label(new Rect(10, 20, 400, 40), "Custom Leader Board GUI Example", headerStyle);

        if (GUI.Button(new Rect(400, 10, 150, 50), "Load Friends Scores"))
        {
            GameCenterManager.loadScore(leaderBoardId, 1, 10, GCBoardTimeSpan.ALL_TIME, GCCollectionType.FRIENDS);
        }

        if (GUI.Button(new Rect(600, 10, 150, 50), "Load Global Scores"))
        {
            GameCenterManager.loadScore(leaderBoardId, 1, 10, GCBoardTimeSpan.ALL_TIME, GCCollectionType.GLOBAL);
        }

        Color defaultColor = GUI.color;

        if (diplayCollection == GCCollectionType.GLOBAL)
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(800, 10, 170, 50), "Displying Global Scores"))
        {
            diplayCollection = GCCollectionType.GLOBAL;
        }
        GUI.color = defaultColor;



        if (diplayCollection == GCCollectionType.FRIENDS)
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(800, 70, 170, 50), "Displying Friends Scores"))
        {
            diplayCollection = GCCollectionType.FRIENDS;
        }
        GUI.color = defaultColor;

        GUI.Label(new Rect(10, 90, 100, 40), "rank", boardStyle);
        GUI.Label(new Rect(100, 90, 100, 40), "score", boardStyle);
        GUI.Label(new Rect(200, 90, 100, 40), "playerId", boardStyle);
        GUI.Label(new Rect(400, 90, 100, 40), "name ", boardStyle);
        GUI.Label(new Rect(550, 90, 100, 40), "avatar ", boardStyle);

        if (loadedLeaderBoard != null)
        {
            for (int i = 1; i < 10; i++)
            {
                GCScore score = loadedLeaderBoard.GetScore(i, GCBoardTimeSpan.ALL_TIME, diplayCollection);
                if (score != null)
                {
                    GUI.Label(new Rect(10, 90 + 70 * i, 100, 40), i.ToString(), boardStyle);
                    GUI.Label(new Rect(100, 90 + 70 * i, 100, 40), score.GetIntScore().ToString(), boardStyle);
                    GUI.Label(new Rect(200, 90 + 70 * i, 100, 40), score.playerId, boardStyle);


                    GameCenterPlayerTemplate player = GameCenterManager.GetPlayerById(score.playerId);
                    if (player != null)
                    {
                        GUI.Label(new Rect(400, 90 + 70 * i, 100, 40), player.alias, boardStyle);
                        if (player.avatar != null)
                        {
                            GUI.DrawTexture(new Rect(550, 75 + 70 * i, 50, 50), player.avatar);
                        }
                        else
                        {
                            GUI.Label(new Rect(550, 90 + 70 * i, 100, 40), "no photo ", boardStyle);
                        }
                    }

                    if (GUI.Button(new Rect(650, 90 + 70 * i, 100, 30), "Chalange"))
                    {
                        GameCenterManager.issueLeaderboardChallenge(leaderBoardId, "Your message here", score.playerId);
                    }
                }
            }
        }
    }
Esempio n. 14
0
	public ISN_UserInfoLoadResult(GameCenterPlayerTemplate tpl):base(true) {
		_tpl = tpl;
	}