Example #1
0
	private void Actions() {
		SocialPlatfromSettings.Instance.ShowActions = EditorGUILayout.Foldout(SocialPlatfromSettings.Instance.ShowActions, "More Actions");
		if(SocialPlatfromSettings.Instance.ShowActions) {
				
			if(!PluginsInstalationUtil.IsFacebookInstalled) {
				GUI.enabled = false;
			}	
				
			EditorGUILayout.BeginHorizontal();
			EditorGUILayout.Space();
				
			if(GUILayout.Button("Remove Facebook SDK",  GUILayout.Width(160))) {
				PluginsInstalationUtil.Remove_FB_SDK_WithDialog();
			}

			if(GUILayout.Button("Reset Settings",  GUILayout.Width(160))) {
				ResetSettings();
			}
				
			GUI.enabled = true;


			EditorGUILayout.EndHorizontal();
			EditorGUILayout.Space();
				
				
			EditorGUILayout.BeginHorizontal();
			EditorGUILayout.Space();
			
				
			if(GUILayout.Button("Load Example Settings",  GUILayout.Width(160))) {
				LoadExampleSettings();
			}
				

			if(GUILayout.Button("Reinstall",  GUILayout.Width(160))) {
				PluginsInstalationUtil.Android_UpdatePlugin();
				PluginsInstalationUtil.IOS_UpdatePlugin();
				UpdateVersionInfo();
				
			}

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


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

			if(GUILayout.Button("Remove",  GUILayout.Width(160))) {
				SA_RemoveTool.RemovePlugins();
			}
				
			EditorGUILayout.EndHorizontal();	
		}
	}
Example #2
0
    private void GeneralOptions()
    {
        if (!IsInstalled)
        {
            EditorGUILayout.HelpBox("Install Required ", MessageType.Error);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();
            Color c = GUI.color;
            GUI.color = Color.cyan;
            if (GUILayout.Button("Install Plugin", GUILayout.Width(120)))
            {
                PluginsInstalationUtil.Android_InstallPlugin();
                PluginsInstalationUtil.IOS_InstallPlugin();
                FileStaticAPI.CreateFile(ios_install_mark_file);
                UpdateVersionInfo();
            }
            GUI.color = c;
            EditorGUILayout.EndHorizontal();
        }

        if (IsInstalled)
        {
            if (!IsUpToDate)
            {
                EditorGUILayout.HelpBox("Update Required \nResources version: " + DataVersion + " Plugin version: " + UltimateMobileSettings.VERSION_NUMBER, MessageType.Warning);


                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.Space();
                Color c = GUI.color;
                GUI.color = Color.cyan;
                if (GUILayout.Button("Update to " + UltimateMobileSettings.VERSION_NUMBER, GUILayout.Width(250)))
                {
                    PluginsInstalationUtil.Android_UpdatePlugin();
                    PluginsInstalationUtil.IOS_UpdatePlugin();

                    UpdateVersionInfo();
                }

                GUI.color = c;
                EditorGUILayout.Space();
                EditorGUILayout.EndHorizontal();
            }
            else
            {
                EditorGUILayout.HelpBox("Ultimate Mobile Plugin v" + UltimateMobileSettings.VERSION_NUMBER + " is installed", MessageType.Info);


                Actions();
            }
        }


        EditorGUILayout.Space();
    }
Example #3
0
    private void Actions()
    {
        EditorGUILayout.Space();



        settings.IsMoreSettingsOpen = EditorGUILayout.Foldout(settings.IsMoreSettingsOpen, "More Settings");
        if (settings.IsMoreSettingsOpen)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();

            if (GUILayout.Button("Android Native Settings ", GUILayout.Width(140)))
            {
                Selection.activeObject = AndroidNativeSettings.Instance;
            }

            if (GUILayout.Button("IOS Native Settings ", GUILayout.Width(140)))
            {
                Selection.activeObject = IOSNativeSettings.Instance;
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();



            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();
            if (GUILayout.Button("Analytics Settings ", GUILayout.Width(140)))
            {
                Selection.activeObject = GoogleAnalyticsSettings.Instance;
            }

            if (GUILayout.Button("Google Ad Settings ", GUILayout.Width(140)))
            {
                Selection.activeObject = GoogleMobileAdSettings.Instance;
            }

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


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


            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
        }



        settings.IsMoreActionsOpen = EditorGUILayout.Foldout(settings.IsMoreActionsOpen, "More Actions");
        if (settings.IsMoreActionsOpen)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();

            if (GUILayout.Button("Open Manifest ", GUILayout.Width(140)))
            {
                UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal("Assets" + AN_ManifestManager.MANIFEST_FILE_PATH, 1);
            }

            bool IsIOSGoogleAdEnabled = FileStaticAPI.IsFileExists(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.h");

            string buttonTitle = "Disable Google Ad(IOS)";
            if (!IsIOSGoogleAdEnabled)
            {
                buttonTitle = "Enable Google Ad for IOS";
            }



            if (GUILayout.Button(buttonTitle, GUILayout.Width(140)))
            {
                string IOSADBannerContent               = FileStaticAPI.Read("Extensions/GoogleMobileAd/Scripts/IOS/IOSADBanner.cs");
                string IOSAdMobControllerContent        = FileStaticAPI.Read("Extensions/GoogleMobileAd/Scripts/IOS/IOSAdMobController.cs");
                string GoogleMobileAdPostProcessContent = FileStaticAPI.Read("Extensions/GoogleMobileAd/Scripts/Editor/GoogleMobileAdPostProcess.cs");


                if (IsIOSGoogleAdEnabled)
                {
                    IOSADBannerContent               = IOSADBannerContent.Replace("//#define CODE_DISABLED", "#define CODE_DISABLED");
                    IOSAdMobControllerContent        = IOSAdMobControllerContent.Replace("//#define CODE_DISABLED", "#define CODE_DISABLED");
                    GoogleMobileAdPostProcessContent = GoogleMobileAdPostProcessContent.Replace("//#define CODE_DISABLED", "#define CODE_DISABLED");

                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADAdMobExtras.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADAdNetworkExtras.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADAdSize.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADBannerViewDelegate.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADInAppPurchase.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADInAppPurchaseDelegate.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADInterstitialDelegate.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADModules.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADRequest.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GADRequestError.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.h");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.mm");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.mm");
                    FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "libGoogleAdMobAds.a");
                }
                else
                {
                    IOSADBannerContent               = IOSADBannerContent.Replace("#define CODE_DISABLED", "//#define CODE_DISABLED");
                    IOSAdMobControllerContent        = IOSAdMobControllerContent.Replace("#define CODE_DISABLED", "//#define CODE_DISABLED");
                    GoogleMobileAdPostProcessContent = GoogleMobileAdPostProcessContent.Replace("#define CODE_DISABLED", "//#define CODE_DISABLED");

                    PluginsInstalationUtil.IOS_UpdatePlugin();
                }


                FileStaticAPI.Write("Extensions/GoogleMobileAd/Scripts/IOS/IOSADBanner.cs", IOSADBannerContent);
                FileStaticAPI.Write("Extensions/GoogleMobileAd/Scripts/IOS/IOSAdMobController.cs", IOSAdMobControllerContent);
                FileStaticAPI.Write("Extensions/GoogleMobileAd/Scripts/Editor/GoogleMobileAdPostProcess.cs", GoogleMobileAdPostProcessContent);
            }

            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
        }
    }
    private void Actions()
    {
        EditorGUILayout.Space();


        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Keep Android Mnifest Clean");

        EditorGUI.BeginChangeCheck();
        SocialPlatfromSettings.Instance.KeepManifestClean = EditorGUILayout.Toggle(SocialPlatfromSettings.Instance.KeepManifestClean);
        if (EditorGUI.EndChangeCheck())
        {
            UpdateManifest();
        }

        if (GUILayout.Button("[?]", GUILayout.Width(25)))
        {
            Application.OpenURL("http://goo.gl/018lnQ");
        }
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        EditorGUILayout.EndHorizontal();


        SocialPlatfromSettings.Instance.ShowAPIS = EditorGUILayout.Foldout(SocialPlatfromSettings.Instance.ShowAPIS, "Mobile Social Plugin APIs");
        if (SocialPlatfromSettings.Instance.ShowAPIS)
        {
            EditorGUI.indentLevel++;

            EditorGUI.BeginChangeCheck();
            DrawAPIsList();
            if (EditorGUI.EndChangeCheck())
            {
                UpdateManifest();
            }


            EditorGUI.indentLevel--;
            EditorGUILayout.Space();
        }

        SocialPlatfromSettings.Instance.ShowActions = EditorGUILayout.Foldout(SocialPlatfromSettings.Instance.ShowActions, "More Actions");
        if (SocialPlatfromSettings.Instance.ShowActions)
        {
            if (!IsFacebookInstalled)
            {
                GUI.enabled = false;
            }

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

            if (GUILayout.Button("Remove Facebook SDK", GUILayout.Width(160)))
            {
                bool result = EditorUtility.DisplayDialog(
                    "Removing Facebook SDK",
                    "Warning action can not be undone without reimporting the plugin",
                    "Remove",
                    "Cansel");
                if (result)
                {
                    FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "facebook");
                    FileStaticAPI.DeleteFolder("Facebook");
                    FileStaticAPI.DeleteFolder("Extensions/GooglePlayCommon/Social/Facebook");
                    FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSPFacebookUseExample.cs");
                    FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSP_FacebookAnalyticsExample.cs");
                    FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSP_FacebookAndroidTurnBasedAndGiftsExample.cs");
                    FileStaticAPI.CopyFile("Extensions/StansAssetsCommon/SA_FB_PlaceHolder.txt", "Extensions/StansAssetsCommon/SA_FB_PlaceHolder.cs");
                }
            }

            if (GUILayout.Button("Reset Settings", GUILayout.Width(160)))
            {
                ResetSettings();
            }

            GUI.enabled = true;


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


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


            if (GUILayout.Button("Load Example Settings", GUILayout.Width(160)))
            {
                LoadExampleSettings();
            }


            if (GUILayout.Button("Reinstall", GUILayout.Width(160)))
            {
                PluginsInstalationUtil.Android_UpdatePlugin();
                PluginsInstalationUtil.IOS_UpdatePlugin();
                UpdateVersionInfo();
            }

            EditorGUILayout.EndHorizontal();
        }
    }
    private void Actions()
    {
        SocialPlatfromSettings.Instance.ShowActions = EditorGUILayout.Foldout(SocialPlatfromSettings.Instance.ShowActions, "More Actions");
        if (SocialPlatfromSettings.Instance.ShowActions)
        {
            if (!IsFacebookInstalled)
            {
                GUI.enabled = false;
            }

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

            if (GUILayout.Button("Remove Facebook SDK", GUILayout.Width(160)))
            {
                bool result = EditorUtility.DisplayDialog(
                    "Removing Facebook SDK",
                    "Warning action can not be undone without reimporting the plugin",
                    "Remove",
                    "Cansel");
                if (result)
                {
                    PluginsInstalationUtil.Remove_FB_SDK();
                }
            }

            if (GUILayout.Button("Reset Settings", GUILayout.Width(160)))
            {
                ResetSettings();
            }

            GUI.enabled = true;


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


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


            if (GUILayout.Button("Load Example Settings", GUILayout.Width(160)))
            {
                LoadExampleSettings();
            }


            if (GUILayout.Button("Reinstall", GUILayout.Width(160)))
            {
                PluginsInstalationUtil.Android_UpdatePlugin();
                PluginsInstalationUtil.IOS_UpdatePlugin();
                UpdateVersionInfo();
            }


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


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

            if (GUILayout.Button("Remove", GUILayout.Width(160)))
            {
                SA_RemoveTool.RemovePlugins();
            }

            EditorGUILayout.EndHorizontal();
        }
    }
 public static void ISN_Plugin_Install()
 {
     PluginsInstalationUtil.IOS_UpdatePlugin();
     UpdateVersionInfo();
     UpdatePluginSettings();
 }