コード例 #1
0
        public override void OnInspectorGUI()
        {
            t = (LEADERBOARDIDS)target;

            if (t.FIRST_TIME)
            {
                Debug.Log("*********** APP_ADVISORY_FIRST_TIME_LEADERBORD ***********");

                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS, SetString("VSLEADERBOARD"));

                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, SetString("VSLEADERBOARD"));

                t.FIRST_TIME = false;
            }

            Enable_iOS = EditorGUILayout.BeginToggleGroup(new GUIContent("Enable iOS Game Center   [?]", "Activate if you want to use Game Center Leaderboard"), Enable_iOS);
            EditorGUILayout.EndToggleGroup();

            Enable_Android = EditorGUILayout.BeginToggleGroup(new GUIContent("Enable Android Google Play Game Services   [?]", "Activate if you want to use Google Play Game Services Leaderboard"), Enable_Android);
            EditorGUILayout.EndToggleGroup();

                        #if VSLEADERBOARD_ENABLE_IOS
            var stringIos = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS);
            if (!stringIos.Contains("APPADVISORY_LEADERBOARD"))
            {
                stringIos = "APPADVISORY_LEADERBOARD" + ";" + stringIos;

                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS, stringIos);
            }
                        #endif

                        #if VSLEADERBOARD_ENABLE_ANDROID
            var stringAndroid = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android);
            if (!stringAndroid.Contains("APPADVISORY_LEADERBOARD"))
            {
                stringAndroid = "APPADVISORY_LEADERBOARD" + ";" + stringAndroid;

                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, stringAndroid);
            }
                        #endif

                        #if VSLEADERBOARD_ENABLE_ANDROID
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("GET\nGoogle Play Game\nSDK", GUILayout.Width(150), GUILayout.Height(50)))
            {
                Application.OpenURL("https://github.com/playgameservices/play-games-plugin-for-unity");
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
                        #endif

                        #if VSLEADERBOARD_ENABLE_IOS
            EditorGUILayout.LabelField(new GUIContent("Game Center Leaderboard Id   [?]", "Find it on Itunes Connect console"));
            t.LEADERBOARDID_IOS = EditorGUILayout.TextField(t.LEADERBOARDID_IOS);
                        #endif


            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();

                        #if VSLEADERBOARD_ENABLE_ANDROID
            EditorGUILayout.LabelField(new GUIContent("Google Play Game Leaderboard Id   [?]", "Find it on Google Play Game console"));
            t.LEADERBOARDID_ANDROID = EditorGUILayout.TextField(t.LEADERBOARDID_ANDROID);
                        #endif

            if (GUI.changed)
            {
                EditorUtility.SetDirty(t);
            }
        }
コード例 #2
0
 public void SetLEADERBORDIDS(LEADERBOARDIDS t)
 {
     this.leaderboardIds = t;
 }