Esempio n. 1
0
        public override void OnInspectorGUI()
        {
            LEADERBOARDIDS t = (LEADERBOARDIDS)target;

            if (!PlayerPrefs.HasKey("APP_ADVISORY_FIRST_TIME_LEADERBORD"))
            {
                Debug.Log("APP_ADVISORY_FIRST_TIME_LEADERBORD");
                PlayerPrefs.SetInt("APP_ADVISORY_FIRST_TIME_LEADERBORD", 0);
                PlayerPrefs.Save();

                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS, SetString(PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS)));

                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, SetString(PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android)));
            }

            var stringIos     = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS);
            var stringAndroid = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android);

            if (!stringIos.Contains("APPADVISORY_LEADERBOARD"))
            {
                stringIos = "APPADVISORY_LEADERBOARD" + ";" + stringIos;

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

            if (!stringAndroid.Contains("APPADVISORY_LEADERBOARD"))
            {
                stringAndroid = "APPADVISORY_LEADERBOARD" + ";" + stringAndroid;

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

            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();

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

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

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

            if (GUI.changed)
            {
                EditorUtility.SetDirty(t);
                PlayerPrefs.Save();
            }
        }
Esempio n. 2
0
        public static void CreateLeaderboardettings()
        {
            LEADERBOARDIDS asset = ScriptableObject.CreateInstance <LEADERBOARDIDS>();

            AssetDatabase.CreateAsset(asset, PathToAsset);
            AssetDatabase.SaveAssets();

            EditorUtility.FocusProjectWindow();

            Selection.activeObject = asset;
        }
Esempio n. 3
0
 public void SetLEADERBORDIDS(LEADERBOARDIDS t)
 {
     this.leaderboardIds = t;
 }
        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);
            }
        }