public static void SetPluginImportEnabled(BuildTarget buildTarget, bool enabled) { #if !(UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6) try { PluginImporter[] pluginImporters = PluginImporter.GetAllImporters(); foreach (PluginImporter pluginImporter in pluginImporters) { bool everyplayIosPluginImporter = pluginImporter.assetPath.Contains("Plugins/Everyplay/iOS"); bool everyplayAndroidPluginImporter = pluginImporter.assetPath.Contains("Plugins/Android/everyplay"); if (everyplayIosPluginImporter || everyplayAndroidPluginImporter) { pluginImporter.SetCompatibleWithAnyPlatform(false); pluginImporter.SetCompatibleWithEditor(false); if ((buildTarget == kBuildTargetIOS) && everyplayIosPluginImporter) { pluginImporter.SetCompatibleWithPlatform(buildTarget, enabled); if (enabled) { string frameworkDependencies = "AssetsLibrary;" + "MessageUI;" + "Security;" + "StoreKit;"; string weakFrameworkDependencies = "Social;" + "CoreImage;" + "Twitter;" + "Accounts;"; // Is there a way to make some dependencies weak in PluginImporter? pluginImporter.SetPlatformData(kBuildTargetIOS, "FrameworkDependencies", frameworkDependencies + weakFrameworkDependencies); } } else if ((buildTarget == BuildTarget.Android) && everyplayAndroidPluginImporter) { pluginImporter.SetCompatibleWithPlatform(buildTarget, enabled); } } } } catch (Exception e) { Debug.Log("Changing plugin import settings failed: " + e); } #endif }
private static void SetEditorData(PluginImporter pluginImporter, string cpu, string os) { if (!pluginImporter.GetEditorData("CPU").Equals(cpu)) { pluginImporter.SetEditorData("CPU", cpu); mHasAtLeastOneLibraryBeenModified = true; } if (!pluginImporter.GetEditorData("OS").Equals(os)) { pluginImporter.SetEditorData("OS", os); mHasAtLeastOneLibraryBeenModified = true; } }
/// <summary> /// Helper function to re-enable the Remote Debug plugin after building. /// Call this function once your build has finished. /// </summary> /// <param name="buildTarget"></param> public static void EnableRemoteDebug(BuildTarget buildTarget) { var importers = PluginImporter.GetAllImporters(); var dllName = GetRemoteDebugDLLName(buildTarget); foreach (var importer in importers) { if (importer.assetPath.IndexOf(dllName, StringComparison.OrdinalIgnoreCase) >= 0) { Debug.Log("Remote Debug: Enabling Remote Debug plugin.."); importer.SetCompatibleWithPlatform(buildTarget, true); } } }
/// <summary> /// Returns the path to Remote Debug. /// </summary> /// <returns>Relative plugin path</returns> private static string FindRemoteDebugPath() { var importers = PluginImporter.GetAllImporters(); foreach (var importer in importers) { if (importer.assetPath.IndexOf("HdgRemoteDebugRuntime", StringComparison.OrdinalIgnoreCase) >= 0) { return(importer.assetPath); } } return(""); }
static bool SetCompatibleWithEditor(PluginImporter plugin) { bool didUpdate = false; didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSX, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows64, false); return(didUpdate); }
protected virtual Plugin GetPluginFor(PluginImporter imp, BuildTarget target, string destinationPath) { // Skip .cpp files. They get copied to il2cpp output folder just before code compilation if (DesktopPluginImporterExtension.IsCppPluginFile(imp.assetPath)) { return(null); } return(new Plugin { AssetPath = imp.assetPath, DestinationPath = destinationPath, }); }
internal bool UpdateIncompatibleWithPlatforms(PluginImporter pluginImporter) { var hasUpdated = false; foreach (var incompatiblePlatform in IncompatiblePlatforms) { if (!pluginImporter.GetExcludeFromAnyPlatform(incompatiblePlatform)) { pluginImporter.SetExcludeFromAnyPlatform(incompatiblePlatform, true); hasUpdated = true; } } return(hasUpdated); }
internal bool UpdateCompatibleWithPlatform(PluginImporter pluginImporter) { if (CompatiblePlatform != 0 && !pluginImporter.GetCompatibleWithPlatform(CompatiblePlatform)) { pluginImporter.SetCompatibleWithPlatform(CompatiblePlatform, true); if (!string.IsNullOrEmpty(CPU)) { pluginImporter.SetPlatformData(CompatiblePlatform, "CPU", CPU); } return(true); } return(false); }
public virtual string CalculateFinalPluginPath(string platformName, PluginImporter imp) { string platformData = imp.GetPlatformData(platformName, "CPU"); string result; if (!string.IsNullOrEmpty(platformData) && string.Compare(platformData, "AnyCPU", true) != 0 && string.Compare(platformData, "None", true) != 0) { result = Path.Combine(platformData, Path.GetFileName(imp.assetPath)); } else { result = Path.GetFileName(imp.assetPath); } return(result); }
private static void SetTargetCPU(PluginImporter pluginImporter, List <BuildTarget> buildTargets, string editorCPU, string targetCPU, string targetOS, bool addToEditor) { foreach (var buildTarget in buildTargets) { Debug.LogFormat("TriLib: Changing Target CPU of '{0}' to '{1}'", pluginImporter.assetPath, targetCPU); pluginImporter.SetPlatformData(buildTarget, "CPU", targetCPU); } if (addToEditor) { Debug.LogFormat("TriLib: Changing Editor Target CPU of '{0}' to '{1}'", pluginImporter.assetPath, editorCPU); pluginImporter.SetEditorData("CPU", editorCPU); Debug.LogFormat("TriLib: Changing Editor Target OS of '{0}' to '{1}'", pluginImporter.assetPath, targetOS); pluginImporter.SetEditorData("OS", targetOS); } }
public static void DeactivateAllPlugins() { PluginImporter[] importers = PluginImporter.GetAllImporters(); foreach (PluginImporter pluginImporter in importers) { if (!pluginImporter.assetPath.Contains(WwisePluginFolder)) { continue; } pluginImporter.SetCompatibleWithAnyPlatform(false); AssetDatabase.ImportAsset(pluginImporter.assetPath); } }
private static void Enable(params AndroidStore[] enabled) { foreach (AndroidStore p in Enum.GetValues(typeof(AndroidStore))) { string path = string.Format("Assets/Plugins/UnityPurchasing/Bin/Android/{0}.aar", p); var importer = (PluginImporter)PluginImporter.GetAtPath(path); if (null != importer) { var enable = Array.Exists(enabled, x => x == p); importer.SetCompatibleWithPlatform(BuildTarget.Android, enable); } } SetAndroidMode(enabled); }
private static void SetPluginCompatibleAnyPlatform(string path, bool enable) { if (File.Exists(path) == true || Directory.Exists(path) == true) { PluginImporter pluginImporter = PluginImporter.GetAtPath(path) as PluginImporter; if (pluginImporter != null) { if (pluginImporter.GetCompatibleWithAnyPlatform() != enable) { pluginImporter.SetCompatibleWithAnyPlatform(enable); pluginImporter.SaveAndReimport(); } } } }
public static void DisableNativeVideoPlayer() { if (File.Exists(videoPlayerFileName)) { File.Move(videoPlayerFileName, disabledPlayerFileName); File.Move(videoPlayerFileName + ".meta", disabledPlayerFileName + ".meta"); } AssetDatabase.ImportAsset(disabledPlayerFileName); AssetDatabase.DeleteAsset(videoPlayerFileName); // Disable audio plugins PluginImporter audio360 = (PluginImporter)AssetImporter.GetAtPath(audio360PluginPath); PluginImporter audio360exo29 = (PluginImporter)AssetImporter.GetAtPath(audio360Exo29PluginPath); if (audio360 != null && audio360exo29 != null) { audio360.SetCompatibleWithPlatform(BuildTarget.Android, false); audio360exo29.SetCompatibleWithPlatform(BuildTarget.Android, false); audio360.SaveAndReimport(); audio360exo29.SaveAndReimport(); } // remove exoplayer and sourcesets from gradle file (leave other parts since they are harmless). if (File.Exists(gradleTemplatePath)) { // parse the gradle file to check the current version: string currentFile = File.ReadAllText(gradleTemplatePath); List <string> lines = new List <string>(currentFile.Split('\n')); int dependencies = GoToSection("dependencies", lines); int exoplayer = FindInScope("com\\.google\\.android\\.exoplayer:exoplayer", dependencies + 1, lines); if (exoplayer != -1) { lines.RemoveAt(exoplayer); } int android = GoToSection("android", lines); int sourceSets = FindInScope("sourceSets\\.main\\.java\\.srcDir", android + 1, lines); if (sourceSets != -1) { lines.RemoveAt(sourceSets); } File.WriteAllText(gradleTemplatePath, string.Join("\n", lines.ToArray())); } }
public void OnPreprocessBuild(BuildTarget target, string path) { var pluginsBasePath = TriLibProjectUtils.FindPathRelativeToProject("Plugins"); var buildTarget = target; #endif if (buildTarget == BuildTarget.iOS) { var pluginsLabel = UnityEditorInternal.InternalEditorUtility.inBatchMode || EditorUtility.DisplayDialog("TriLib", "Building to iOS Device (iPhone, iPad) or iOS Simulator?", "release", "debug") ? "_TriLib_iOS_Device_" : "_TriLib_iOS_Simulator_"; #if UNITY_EDITOR_OSX _iosFileSharingEnabled = UnityEditorInternal.InternalEditorUtility.inBatchMode || EditorUtility.DisplayDialog("TriLib", "Enable iOS File Sharing?", "Yes", "No"); #endif var iOSImporters = PluginImporter.GetImporters(BuildTarget.iOS); foreach (var importer in iOSImporters) { if (importer.isNativePlugin) { if (importer.assetPath.StartsWith(string.Format((string)"{0}/iOS/", (object)pluginsBasePath))) { importer.SetIncludeInBuildDelegate(assetPath => importer.assetPath.EndsWith(pluginsLabel)); } } } if (!UnityEditorInternal.InternalEditorUtility.inBatchMode) { #if UNITY_EDITOR_OSX EditorUtility.DisplayDialog("TriLib", "Warning: Bitcode is not supported by TriLib and will be disabled.", "Ok"); #else EditorUtility.DisplayDialog("TriLib", "Warning:\nBitcode is not supported. You should disable it on your project settings.\nZLIB library should be included in your project frameworks.", "Ok"); #endif } } var allImporters = PluginImporter.GetImporters(buildTarget); foreach (var importer in allImporters) { if (!importer.isNativePlugin) { if (importer.assetPath == string.Format((string)"{0}/ICSharpCode.SharpZipLib.dll", (object)pluginsBasePath)) { #if TRILIB_USE_ZIP importer.SetIncludeInBuildDelegate(assetPath => PlayerSettings.GetScriptingBackend(BuildPipeline.GetBuildTargetGroup(buildTarget)) != ScriptingImplementation.WinRTDotNET); #else importer.SetIncludeInBuildDelegate(assetPath => false); #endif } } } }
static void PrepareWin10() { PluginImporter pi; pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/VungleSDKProxy.dll"); pi.SetCompatibleWithAnyPlatform(false); pi.SetCompatibleWithEditor(true); pi.SaveAndReimport(); pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/VungleSDKProxy.winmd"); pi.SetPlatformData(BuildTarget.WSAPlayer, "PlaceholderPath", "Assets/Plugins/VungleSDKProxy.dll"); pi.SaveAndReimport(); pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/UWP/VungleSDK.winmd"); pi.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP"); pi.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true); pi.SaveAndReimport(); }
public void CheckPluginsImported() { bool pluginFound = false; PluginImporter[] importers = PluginImporter.GetImporters(BuildTarget.WSAPlayer); foreach (PluginImporter importer in importers) { if (importer.assetPath.Contains("Holographic")) { pluginFound = true; break; } } Assert.IsTrue(pluginFound, "Plugins failed to import."); }
private void CheckWSADllPlatforms() { #if !UNITY_4 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 string pluginPath = "Assets/Plugins/UTNotifications.dll"; PluginImporter pluginImporter = ((PluginImporter)AssetImporter.GetAtPath(pluginPath)); if (pluginImporter.GetCompatibleWithAnyPlatform() || pluginImporter.GetCompatibleWithPlatform(BuildTarget.WSAPlayer)) { pluginImporter.SetCompatibleWithAnyPlatform(false); pluginImporter.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); pluginImporter.SetCompatibleWithEditor(true); pluginImporter.SaveAndReimport(); AssetDatabase.ImportAsset(pluginPath); } #endif }
static void UpdateVuforiaMediaPluginSettings() { // Unregister callback (executed only once) EditorApplication.update -= UpdateVuforiaMediaPluginSettings; PluginImporter[] importers = PluginImporter.GetAllImporters(); foreach (var imp in importers) { string pluginPath = imp.assetPath; if (pluginPath.EndsWith("VuforiaMediaSource") && imp.GetCompatibleWithAnyPlatform()) { Debug.Log("Disabling 'Any Platform' for plugin: " + pluginPath); imp.SetCompatibleWithAnyPlatform(false); } } }
private static bool DisableDLL(string pathToDLL) { if (HasCompatibility(pathToDLL, new BuildTarget[] {}, false)) { return(false); } PluginImporter pluginImporter = (PluginImporter)AssetImporter.GetAtPath(pathToDLL); pluginImporter.ClearSettings(); pluginImporter.SetCompatibleWithAnyPlatform(false); pluginImporter.SaveAndReimport(); return(true); }
public void CheckPluginsImported() { bool pluginFound = false; PluginImporter[] importers = PluginImporter.GetImporters(BuildTarget.StandaloneWindows64); foreach (PluginImporter importer in importers) { if (importer.assetPath.Contains("OVRPlugin")) { pluginFound = true; break; } } Assert.IsTrue(pluginFound, "Plugins failed to import."); }
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { #if UNITY_4 && UNITY_IPHONE if (PlayerSettings.apiCompatibilityLevel.Equals(ApiCompatibilityLevel.NET_2_0_Subset)) { if (EditorUtility.DisplayDialog("Appodeal Unity", "We have detected that you're using subset API compatibility level: " + PlayerSettings.apiCompatibilityLevel + " you should change it to NET_2_0 to be able using Ionic.ZIP.dll.", "Change it for me", "I'll do it")) { PlayerSettings.apiCompatibilityLevel = ApiCompatibilityLevel.NET_2_0; } } #endif #if UNITY_4 if (File.Exists(Utils.FixSlashesInPath("Assets/Appodeal/SampleAndroidManifest.xml")) && !File.Exists(Utils.FixSlashesInPath("Assets/Plugins/Android/AndroidManifest.xml")) && moveManifest) { if (EditorUtility.DisplayDialog("Appodeal Unity", "We have detected that you have no AndroidManifest.xml inside Android folder, it should override Unity's settings to fix not clickable ads", "Place template for me", "Don't do that!")) { FileUtil.CopyFileOrDirectory(Utils.FixSlashesInPath("Assets/Appodeal/SampleAndroidManifest.xml"), Utils.FixSlashesInPath("Assets/Plugins/Android/AndroidManifest.xml")); } } #endif #if UNITY_5 foreach (string plugin in Plugins) { string fullpath = Utils.FixSlashesInPath("Assets/Plugins/Android/" + plugin); if (File.Exists(fullpath)) { PluginImporter pluginImporter = AssetImporter.GetAtPath(fullpath) as PluginImporter; if (!pluginImporter.GetCompatibleWithPlatform(BuildTarget.Android)) { pluginImporter.SetCompatibleWithPlatform(BuildTarget.Android, true); } } } string path = Utils.FixSlashesInPath("Assets/Plugins/Ionic.Zip.Unity.dll"); if (File.Exists(path)) { PluginImporter ionicPluginImporter = AssetImporter.GetAtPath(path) as PluginImporter; if (!ionicPluginImporter.GetCompatibleWithEditor()) { ionicPluginImporter.SetCompatibleWithEditor(true); } } #endif }
/// <summary> /// Enable the appropriate plugins from the SDK Type and SDK Version in the iOS Build Target before building. /// </summary> public void OnPreprocessBuild(BuildReport report) { // Skip the process if the build is not for iOS. if (report.summary.platform != BuildTarget.iOS) { return; } // Detect the type of iOS plugin by SDK type and SDK version in the build settings. CubismiOSPlugin targetPlugin; if (EditorUserBuildSettings.iOSBuildConfigType == iOSBuildType.Debug) { targetPlugin = PlayerSettings.iOS.sdkVersion == iOSSdkVersion.DeviceSDK ? CubismiOSPlugin.DebugIphoneos : CubismiOSPlugin.DebugIphoneSimulator; } else { targetPlugin = PlayerSettings.iOS.sdkVersion == iOSSdkVersion.DeviceSDK ? CubismiOSPlugin.ReleaseIphoneos : CubismiOSPlugin.ReleaseIphoneSimulator; } // Extract the Cubism iOS plugin from the plugin. var pluginImporters = PluginImporter.GetAllImporters() .Where(pluginImporter => Regex.IsMatch( pluginImporter.assetPath, @"^.*/iOS/.*/libLive2DCubismCore.a$" ) ) .ToArray(); // Enable only the appropriate plugins. foreach (var pluginImporter in pluginImporters) { pluginImporter.SetCompatibleWithPlatform( BuildTarget.iOS, pluginImporter.assetPath.Contains(targetPlugin.DirectoryName) ); } }
public void OnPreprocessBuild(BuildReport report) { var extensions = FeatureHelpersInternal.GetAllFeatureInfo(report.summary.platformGroup); // Keep set of seen plugins, only disable plugins that haven't been seen. HashSet <string> seenPlugins = new HashSet <string>(); // Loop over all the native plugin importers and only include the enabled ones in the build var importers = PluginImporter.GetAllImporters(); foreach (var importer in importers) { if (!importer.GetCompatibleWithPlatform(report.summary.platform)) { continue; } if (importer.assetPath.Contains("openxr_loader")) { if (extensions.CustomLoaderBuildTargets?.Contains(report.summary.platform) ?? false) { importer.SetIncludeInBuildDelegate(path => false); } else { importer.SetIncludeInBuildDelegate(path => true); } } var root = Path.GetDirectoryName(importer.assetPath); foreach (var extInfo in extensions.Features) { if (root != null && root.Contains(extInfo.PluginPath)) { if (extInfo.Feature.enabled) { importer.SetIncludeInBuildDelegate(path => true); } else if (!seenPlugins.Contains(importer.assetPath)) { importer.SetIncludeInBuildDelegate(path => false); } seenPlugins.Add(importer.assetPath); } } } }
static public void Run() { // called only once if (!File.Exists(tempFilePath)) { var importers = PluginImporter.GetAllImporters().Where(importer => importer.assetPath.Contains("libEffekseerUnity.bc")); if (importers.Count() > 0) { foreach (var importer in importers) { importer.SetCompatibleWithPlatform(BuildTarget.WebGL, importer.assetPath.Contains(bcPath)); } File.Create(tempFilePath); } } }
private static void SetIl2cppConfig(bool isCpp, PluginImporter dll) { #if !UNITY_2018_1_OR_NEWER var target = BuildTarget.StandaloneOSX; #else var target = BuildTarget.StandaloneOSX; #endif dll.ClearSettings(); dll.SetCompatibleWithAnyPlatform(false); if (isCpp) { dll.SetCompatibleWithPlatform(target, true); //StandaloneOSX } dll.SaveAndReimport(); }
public static bool IsSdkDllActive(SdkVersion version) { string assembly = version.ToString(); PluginImporter importer = GetImporterForAssemblyString(assembly); if (importer == false) { //Handle Avatar Dll Split importer = GetImporterForAssemblyString(assembly + "A"); if (importer == false) { return(false); } } return(importer.GetCompatibleWithAnyPlatform()); }
public static bool IsSdkDllActive(SdkVersion version) { string assembly = version.ToString(); PluginImporter importer = AssetImporter.GetAtPath("Assets/VRCSDK/Plugins/" + assembly + ".dll") as PluginImporter; if (importer == false) { //Handle Avatar Dll Split importer = AssetImporter.GetAtPath("Assets/VRCSDK/Plugins/" + assembly + "A.dll") as PluginImporter; if (importer == false) { return(false); } } return(importer.GetCompatibleWithAnyPlatform()); }
public static void CheckPluginImportSettings() { string[] guids = AssetDatabase.FindAssets("", new[] { "Packages/com.unity.webrtc/Runtime/Plugins" }); foreach (string guid in guids) { string path = AssetDatabase.GUIDToAssetPath(guid); AssetImporter assetImporter = AssetImporter.GetAtPath(path); Assert.IsNotNull(assetImporter); if (assetImporter.GetType() != typeof(PluginImporter)) { continue; } PluginImporter pluginImporter = assetImporter as PluginImporter; Assert.IsNotNull(pluginImporter); Assert.IsTrue(pluginImporter.isPreloaded); } }
public static void SwitchCompatibleWithPlatform(PluginImporter plugin, bool value) { if (value) { Debug.Log("Platform " + EditorUserBuildSettings.activeBuildTarget + ". Switch Nuitrack dll to " + plugin.assetPath); } plugin.SetCompatibleWithAnyPlatform(false); plugin.SetCompatibleWithPlatform(BuildTarget.iOS, value); plugin.SetCompatibleWithPlatform(BuildTarget.Android, value); plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, value); plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, value); plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, value); plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, value); plugin.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, value); plugin.SetCompatibleWithEditor(value); }
private static void SetStandaloneTarget(PluginImporter pluginImporter, BuildTarget target) { switch(target) { case BuildTarget.StandaloneLinux: pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux, "CPU", "x86"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux64, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinuxUniversal, "CPU", "x86"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel64, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "None"); return; case BuildTarget.StandaloneLinux64: pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux64, "CPU", "x86_64"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinuxUniversal, "CPU", "x86_64"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel64, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "None"); return; case BuildTarget.StandaloneOSXIntel: case BuildTarget.StandaloneOSXIntel64: pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux64, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinuxUniversal, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel, "CPU", "AnyCPU"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel64, "CPU", "AnyCPU"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "AnyCPU"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "None"); return; case BuildTarget.StandaloneWindows: pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux64, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinuxUniversal, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel64, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "AnyCPU"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "None"); return; case BuildTarget.StandaloneWindows64: pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux64, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneLinuxUniversal, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXIntel64, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "None"); pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "AnyCPU"); return; default: return; } }
static bool SetCompatibleWithPlatform(PluginImporter plugin, BuildTarget platform, bool enable) { if (plugin.GetCompatibleWithPlatform(platform) == enable) { return false; } plugin.SetCompatibleWithPlatform(platform, enable); return true; }
static bool SetCompatibleWithEditor(PluginImporter plugin) { bool didUpdate = false; didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel64, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXUniversal, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows64, false); return didUpdate; }
static bool SetCompatibleWithWindows(PluginImporter plugin, BuildTarget platform) { bool didUpdate = false; if (platform == BuildTarget.StandaloneWindows) { didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows, true); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows64, false); } else { didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows64, true); } didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel64, false); didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXUniversal, false); return didUpdate; }
static bool ResetPluginSettings(PluginImporter plugin, string CPU, string OS) { bool didUpdate = false; if (plugin.GetCompatibleWithAnyPlatform() != false) { plugin.SetCompatibleWithAnyPlatform(false); didUpdate = true; } if (plugin.GetCompatibleWithEditor() != true) { plugin.SetCompatibleWithEditor(true); didUpdate = true; } if (plugin.GetEditorData("CPU") != CPU) { plugin.SetEditorData("CPU", CPU); didUpdate = true; } if (plugin.GetEditorData("OS") != OS) { plugin.SetEditorData("OS", OS); didUpdate = true; } return didUpdate; }
private void PluginSettings(PluginImporter.Importer.PluginDescription plugin) { Form f = plugings.PluginSettings(plugin.Name, ref data); f.MdiParent = this; f.Show(); }
private void RunPlugin(PluginImporter.Importer.PluginDescription plugin) { Form f = plugings.ExcecutePlugin(plugin.Name, ref data, GetConnection()); f.MdiParent = this; f.Show(); }
public virtual string CalculateFinalPluginPath(string platformName, PluginImporter imp) { return Path.GetFileName(imp.assetPath); }