void OnGUI()
    {
        beginColumn();

        if (GUILayout.Button("Get Player Alias"))
        {
            string alias = GameCenterBinding.playerAlias();
            Debug.Log("Player alias: " + alias);
        }


        if (_hasFriends)
        {
            // see if we have any friends with a profile image on disk
            var friendWithProfileImage = _friends.Where(f => f.hasProfilePhoto).FirstOrDefault();
            GUI.enabled = friendWithProfileImage != null;
            if (GUILayout.Button("Show Friends Profile Image"))
            {
                var tex = friendWithProfileImage.profilePhoto;

                // grab our cube and display it with the texture
                var cube = GameObject.Find("Cube");
                cube.renderer.enabled = true;
                cube.renderer.material.mainTexture = tex;
            }
            GUI.enabled = true;
        }


        if (GUILayout.Button("Load Received Challenges"))
        {
            GameCenterBinding.loadReceivedChallenges();
        }


        if (GUILayout.Button("Show GC Leaderboards (iOS 6+)"))
        {
            GameCenterBinding.showGameCenterViewController(GameCenterViewControllerState.Leaderboards);
        }


        if (GUILayout.Button("Show GC Achievements (iOS 6+)"))
        {
            GameCenterBinding.showGameCenterViewController(GameCenterViewControllerState.Achievements);
        }


        endColumn(true);



        // toggle to show two different sets of buttons
        if (toggleButtonState("Show Achievement Buttons"))
        {
            leaderboardsGUI();
        }
        else
        {
            achievementsGUI();
        }
        toggleButton("Show Achievement Buttons", "Show Leaderboard Buttons");


        endColumn();


        if (bottomLeftButton("Load Multiplayer Scene (Requires Multiplayer Plugin!)", 340))
        {
            Application.LoadLevel("GameCenterMultiplayerTestScene");
        }
    }
Ejemplo n.º 2
0
 // Sends a request to load all received challenges. iOS 6+ only@
 public void LoadReceivedChallenges()
 {
     GameCenterBinding.loadReceivedChallenges();
 }