Ejemplo n.º 1
0
        void columnOneGeneral()
        {
            if (GUILayout.Button("Get Player Alias"))
            {
                var 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.GetComponent <Renderer>().enabled = true;
                    cube.GetComponent <Renderer>().material.mainTexture = tex;
                }
                GUI.enabled = true;
            }


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


            if (GUILayout.Button("Show Leaderboards"))
            {
                GameCenterBinding.showGameCenterViewController(GameCenterViewControllerState.Leaderboards);
            }


            if (GUILayout.Button("Show Achievements"))
            {
                GameCenterBinding.showGameCenterViewController(GameCenterViewControllerState.Achievements);
            }


            if (GUILayout.Button("Show Challenges"))
            {
                GameCenterBinding.showGameCenterViewController(GameCenterViewControllerState.Challenges);
            }


            if (GUILayout.Button("Generate Identity Signature"))
            {
                GameCenterBinding.generateIdentityVerificationSignature();
            }


            if (GUILayout.Button("Show Custom Notification Banner"))
            {
                GameCenterBinding.showCustomNotificationBanner("This is my custom banner", "It lets me stick whatever I want in a Game Center styled banner", 4f);
            }
        }
Ejemplo n.º 2
0
        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.GetComponent <Renderer>().enabled = true;
                    cube.GetComponent <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);
            }


            if (GUILayout.Button("Generate Identity Signature"))
            {
                GameCenterBinding.generateIdentityVerificationSignature();
            }

            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("Multiplayer Scene (Requires Multiplayer Plugin!)"))
            {
                Application.LoadLevel("GameCenterMultiplayerTestScene");
            }


            if (bottomRightButton("Turn Based Multiplayer Scene (Requires TB Plugin!)"))
            {
                Application.LoadLevel("GCTurnBasedTestScene");
            }
        }