public static void RemoveIOSFile(string filename) { FileStaticAPI.DeleteFile(IOS_DESTANATION_PATH + filename + ".h"); FileStaticAPI.DeleteFile(IOS_DESTANATION_PATH + filename + ".m"); FileStaticAPI.DeleteFile(IOS_DESTANATION_PATH + filename + ".mm"); FileStaticAPI.DeleteFile(IOS_DESTANATION_PATH + filename + ".a"); }
private static void RemoveNativeFile(string filename) { string filePath = "Plugins/IOS/" + filename; FileStaticAPI.DeleteFile(filePath + ".h"); FileStaticAPI.DeleteFile(filePath + ".m"); FileStaticAPI.DeleteFile(filePath + ".mm"); FileStaticAPI.DeleteFile(filePath + ".a"); }
private static void RemoveNativeFileIOS(string filename) { string filePath = PluginsInstalationUtil.IOS_DESTANATION_PATH + filename; FileStaticAPI.DeleteFile(filePath + ".h"); FileStaticAPI.DeleteFile(filePath + ".m"); FileStaticAPI.DeleteFile(filePath + ".mm"); FileStaticAPI.DeleteFile(filePath + ".a"); FileStaticAPI.DeleteFile(filePath + ".txt"); }
private static void RemoveWP8Part() { FileStaticAPI.DeleteFile("Plugins/WP8/GoogleAds.dll"); FileStaticAPI.DeleteFile("Plugins/WP8/GoogleAds.xml"); FileStaticAPI.DeleteFile("Plugins/WP8/MockIAPLib.dll"); FileStaticAPI.DeleteFile("Plugins/WP8/WP8Native.dll"); FileStaticAPI.DeleteFile("Plugins/WP8/WP8PopUps.dll"); FileStaticAPI.DeleteFile("Plugins/WP8/GoogleAdsWP8.dll"); FileStaticAPI.DeleteFile("Plugins/GoogleAdsWP8.dll"); FileStaticAPI.DeleteFile("Plugins/Metro/WP8Native.dll"); FileStaticAPI.DeleteFile("Plugins/Metro/WP8PopUps.dll"); }
public static void IOSCleanUP() { 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 + "libGoogleAdMobAds.a"); }
private static void RemoveAndroidPart() { FileStaticAPI.DeleteFile(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "androidnative.jar"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "mobilenativepopups.jar"); FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "facebook"); FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "libs"); FileStaticAPI.DeleteFolder("Plugins/Android/res/values/analytics.xml"); FileStaticAPI.DeleteFolder("Plugins/Android/res/values/ids.xml"); FileStaticAPI.DeleteFolder("Plugins/Android/res/values/version.xml"); FileStaticAPI.DeleteFolder("Plugins/Android/res/xml/file_paths.xml"); }
private void DrawUpdate() { if (Version <= 4.4f) { EditorGUILayout.HelpBox("AndroidManifest.xml was updated in 4.5 \nNew version contains AndroidManifest.xml chnages, Please remove Assets/Plugins/Android/AndroidManifest.xml file before update or add manualy File Sharing Block from Assets/Plugins/StansAssets/Android/AndroidManifest.xml", MessageType.Warning); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Remove AndroidManifest and Update to " + AndroidNativeSettings.VERSION_NUMBER, GUILayout.Width(250))) { string file = "AndroidManifest.xml"; FileStaticAPI.DeleteFile(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + file); AN_Plugin_Update(); UpdateVersionInfo(); } EditorGUILayout.Space(); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } if (Version <= 4.5f) { EditorGUILayout.HelpBox("AndroidManifest.xml was updated in 4.6 \nNew version contains AndroidManifest.xml chnages, Please remove Assets/Plugins/Android/AndroidManifest.xml file before update or add manualy %APP_BUNDLE_ID% tockens from Assets/Plugins/StansAssets/Android/AndroidManifest.xml", MessageType.Warning); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Remove AndroidManifest and Update to " + AndroidNativeSettings.VERSION_NUMBER, GUILayout.Width(250))) { string file = "AndroidManifest.xml"; FileStaticAPI.DeleteFile(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + file); AN_Plugin_Update(); UpdateVersionInfo(); } EditorGUILayout.Space(); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } }
public static void Remove_FB_SDK() { FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "facebook"); FileStaticAPI.DeleteFolder("Facebook"); FileStaticAPI.DeleteFolder("Extensions/GooglePlayCommon/Social/Facebook"); //AM FileStaticAPI.DeleteFile("Extensions/AndroidNative/xExample/Scripts/Social/FacebookAndroidUseExample.cs"); FileStaticAPI.DeleteFile("Extensions/AndroidNative/xExample/Scripts/Social/FacebookAnalyticsExample.cs"); FileStaticAPI.DeleteFile("Extensions/AndroidNative/xExample/Scripts/Social/FacebookAndroidTurnBasedAndGiftsExample.cs"); //MSP 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"); ChnageDefineState(AN_SoomlaGrowContent, "FACEBOOK_ENABLED", false); }
public static void Remove_FB_SDK() { FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "facebook"); FileStaticAPI.DeleteFolder("Plugins/facebook", false); FileStaticAPI.DeleteFolder("Facebook", false); //MSP FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSPFacebookUseExample.cs", false); FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSP_FacebookAnalyticsExample.cs", false); FileStaticAPI.DeleteFile("Extensions/MobileSocialPlugin/Example/Scripts/MSP_FacebookAndroidTurnBasedAndGiftsExample.cs", false); //FB v7 FileStaticAPI.DeleteFolder("Examples", false); FileStaticAPI.DeleteFolder(PluginsInstalationUtil.IOS_DESTANATION_PATH + "Facebook", false); FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "libs/bolts-android-1.2.0.jar"); FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "libs/facebook-android-sdk-4.7.0.jar"); FileStaticAPI.DeleteFolder(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + "libs/facebook-android-wrapper-release.jar"); AssetDatabase.Refresh(); }
public static void DisableSocialAPI() { FileStaticAPI.DeleteFile(ANDROID_DESTANATION_PATH + "libs/an_social.jar"); FileStaticAPI.DeleteFile(ANDROID_DESTANATION_PATH + "libs/twitter4j-core-3.0.5.jar"); }
public static void DisableBillingAPI() { FileStaticAPI.DeleteFile(ANDROID_DESTANATION_PATH + "libs/an_billing.jar"); }
public static void DisableSoomlaAPI() { FileStaticAPI.DeleteFile(ANDROID_DESTANATION_PATH + "libs/an_sa_soomla.jar"); }
public static void DisableAppLicensingAPI() { FileStaticAPI.DeleteFile(ANDROID_DESTANATION_PATH + "libs/an_licensing_library.jar"); }
public static void DisableGooglePlayAPI() { FileStaticAPI.DeleteFile(ANDROID_DESTANATION_PATH + "libs/google-play-services.jar"); FileStaticAPI.DeleteFile(ANDROID_DESTANATION_PATH + "libs/an_googleplay.jar"); }
public static void UpdateGoogleAdIOSAPI(bool forseDisable = false) { bool IsEnabled = false; if (!forseDisable) { if (UltimateMobileSettings.Instance.IOSAdEdngine == UM_IOSAdEngineOprions.GoogleMobileAd) { IsEnabled = true; } } 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 (IsEnabled) { 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"); } 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"); } 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); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.h.txt"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.mm.txt"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.h.txt"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.mm.txt"); if (IsEnabled) { #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.h.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdController.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.h.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.mm.txt", PluginsInstalationUtil.IOS_DESTANATION_PATH + "GoogleMobileAdBanner.mm"); #else FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.h.txt", PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.mm.txt", PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.mm"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.h.txt", PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.h"); FileStaticAPI.CopyFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.mm.txt", PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.mm"); #endif } else { #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 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"); #else FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.h"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.h"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdBanner.mm"); FileStaticAPI.DeleteFile(PluginsInstalationUtil.IOS_SOURCE_PATH + "GoogleMobileAdController.mm"); #endif } /* * if(IsEnabled) { * Debug.Log("Google Ad for IOS is enabled"); * } else { * Debug.Log("Google Ad for IOS is disabled"); * } */ }
public static void DisableCameraAPI() { FileStaticAPI.DeleteFile(ANDROID_DESTANATION_PATH + "libs/image-chooser-library-1.3.0.jar"); }
private void GeneralOptions() { if (!IsFullVersion) { EditorGUILayout.HelpBox("Mobile Social Plugin v" + SocialPlatfromSettings.VERSION_NUMBER + " is installed", MessageType.Info); Actions(); return; } 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(); UpdateVersionInfo(); } GUI.color = c; EditorGUILayout.EndHorizontal(); } if (IsInstalled) { if (!IsUpToDate) { EditorGUILayout.HelpBox("Update Required \nResources version: " + DataVersion + " Plugin version: " + SocialPlatfromSettings.VERSION_NUMBER, MessageType.Warning); if (Version <= 4.4f) { EditorGUILayout.HelpBox("New version contains AndroidManifest.xml chnages, Please remove Assets/Plugins/Android/AndroidManifest.xml file before update or add manualy File Sharing Block from Assets/Plugins/StansAssets/Android/AndroidManifest.xml", MessageType.Warning); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Remove AndroidManifest and Update to " + SocialPlatfromSettings.VERSION_NUMBER, GUILayout.Width(250))) { string file = "AndroidManifest.xml"; FileStaticAPI.DeleteFile(PluginsInstalationUtil.ANDROID_DESTANATION_PATH + file); PluginsInstalationUtil.Android_UpdatePlugin(); UpdateVersionInfo(); } EditorGUILayout.Space(); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); Color c = GUI.color; GUI.color = Color.cyan; if (GUILayout.Button("Update to " + SocialPlatfromSettings.VERSION_NUMBER, GUILayout.Width(250))) { PluginsInstalationUtil.Android_InstallPlugin(); PluginsInstalationUtil.IOS_InstallPlugin(); UpdateVersionInfo(); } GUI.color = c; EditorGUILayout.Space(); EditorGUILayout.EndHorizontal(); } else { EditorGUILayout.HelpBox("Mobile Social Plugin v" + SocialPlatfromSettings.VERSION_NUMBER + " is installed", MessageType.Info); Actions(); } } EditorGUILayout.Space(); }
private void Actions() { AndroidNativeSettings.Instance.ShowActions = EditorGUILayout.Foldout(AndroidNativeSettings.Instance.ShowActions, "More Actions"); if (AndroidNativeSettings.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/AndroidNative/xExample/Scripts/Social/FacebookAndroidUseExample.cs"); FileStaticAPI.DeleteFile("Extensions/AndroidNative/xExample/Scripts/Social/FacebookAnalyticsExample.cs"); } } GUI.enabled = true; if (GUILayout.Button("Open Manifest ", GUILayout.Width(160))) { UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal("Assets" + AN_ManifestManager.MANIFEST_FILE_PATH, 1); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Reset Settings", GUILayout.Width(160))) { SocialPlatfromSettingsEditor.ResetSettings(); FileStaticAPI.DeleteFile("Extensions/AndroidNative/Resources/AndroidNativeSettings.asset"); AndroidNativeSettings.Instance.ShowActions = true; Selection.activeObject = AndroidNativeSettings.Instance; return; } if (GUILayout.Button("Load Example Settings", GUILayout.Width(160))) { LoadExampleSettings(); } EditorGUILayout.EndHorizontal(); } }
public static void ResetSettings() { FileStaticAPI.DeleteFile("Extensions/GoogleMobileAd/Resources/GoogleMobileAdSettings.asset"); GoogleMobileAdSettings.Instance.ShowActions = true; Selection.activeObject = GoogleMobileAdSettings.Instance; }
public static void Android_InstallPlugin(bool IsFirstInstall = true) { //Unity 5 upgdare: FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/httpclient-4.3.1.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/signpost-commonshttp4-1.2.1.2.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/signpost-core-1.2.1.2.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/libGoogleAnalyticsServices.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/android-support-v4.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/image-chooser-library-1.3.0.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/twitter4j-core-3.0.5.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "libs/google-play-services.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "social/an_social.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "social/twitter4j-core-3.0.5.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "google_play/an_googleplay.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "google_play/google-play-services.jar"); FileStaticAPI.DeleteFile(ANDROID_SOURCE_PATH + "billing/an_billing.jar"); FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "libs/android-support-v4.txt", ANDROID_DESTANATION_PATH + "libs/android-support-v4.jar"); FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "androidnative.txt", ANDROID_DESTANATION_PATH + "androidnative.jar"); FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + "mobilenativepopups.txt", ANDROID_DESTANATION_PATH + "mobilenativepopups.jar"); FileStaticAPI.CopyFolder(ANDROID_SOURCE_PATH + "facebook", ANDROID_DESTANATION_PATH + "facebook"); #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 #else FileStaticAPI.DeleteFolder(ANDROID_SOURCE_PATH + "facebook"); #endif if (IsFirstInstall) { EnableBillingAPI(); EnableGooglePlayAPI(); EnableSocialAPI(); EnableCameraAPI(); EnableAppLicensingAPI(); } string file; file = "AN_Res/res/values/analytics.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } file = "AN_Res/res/values/ids.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } file = "AN_Res/res/xml/file_paths.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } file = "AN_Res/res/values/version.xml"; FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); file = "AN_Res/project.properties"; FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); file = "AN_Res/AndroidManifest.xml"; FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); //First install dependense file = "AndroidManifest.xml"; if (!FileStaticAPI.IsFileExists(ANDROID_DESTANATION_PATH + file)) { FileStaticAPI.CopyFile(ANDROID_SOURCE_PATH + file, ANDROID_DESTANATION_PATH + file); } AssetDatabase.Refresh(); }
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() { 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(); } }
public static void ResetSettings() { FileStaticAPI.DeleteFile("Extensions/GooglePlayCommon/Resources/SocialSettings.asset"); SocialPlatfromSettings.Instance.ShowActions = true; Selection.activeObject = SocialPlatfromSettings.Instance; }