void _SetPlatformData(string platformName, string key, string value) { if (_pluginImporter != null) { if (_pluginImporter.GetPlatformData(platformName, key) != value) { _pluginImporter.SetPlatformData(platformName, key, value); _isWritten = true; } } }
private void UpgradePluginCPU(PluginImporter plugin, BuildTarget buildTarget) { string extension = Path.GetExtension(plugin.assetPath); string platformData = plugin.GetPlatformData(buildTarget, "CPU"); if ((extension == ".so") && (platformData == "AnyCPU")) { plugin.SetPlatformData(buildTarget, "CPU", "ARMv7"); } }
public virtual string CalculateFinalPluginPath(string platformName, PluginImporter imp) { string cpu = imp.GetPlatformData(platformName, "CPU"); if (!string.IsNullOrEmpty(cpu) && (string.Compare(cpu, "AnyCPU", true) != 0) && (string.Compare(cpu, "None", true) != 0)) { return(Path.Combine(cpu, Path.GetFileName(imp.assetPath))); } return(Path.GetFileName(imp.assetPath)); }
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); }
public static void AddFrameworkDependency(string pluginPath, BuildTarget target, string framework) { PluginImporter plugin = AssetImporter.GetAtPath(pluginPath) as PluginImporter; if (plugin == null) { return; } string dependencies = plugin.GetPlatformData(target, "FrameworkDependencies"); if (!dependencies.Contains(framework)) { plugin.SetPlatformData(target, "FrameworkDependencies", dependencies + ";" + framework); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Debug.Log("Adding framework dependency to " + target + ": " + framework); } }
private static void CheckDynamicFrameworkSetting(string searchPath = "Assets/Plugins/IOS") { string[] keys = { "MoPub" }; foreach (string filePath in Directory.GetDirectories(searchPath, "*.framework", searchOption: SearchOption.AllDirectories)) { bool isContainKeyWorld = false; foreach (string key in keys) { if (filePath.Contains(key)) { isContainKeyWorld = true; break; } } if (!isContainKeyWorld) { continue; } PluginImporter importer = AssetImporter.GetAtPath(filePath) as PluginImporter; if (importer == null) { Debug.LogError("PluginImporter not found" + filePath); throw new System.Exception("PluginImporter not found"); } string oldValue = importer.GetPlatformData(BuildTarget.iOS, "AddToEmbeddedBinaries"); if (oldValue != "true") { Debug.Log("begin set AddToEmbeddedBinaries in: " + filePath); importer.SetPlatformData(BuildTarget.iOS, "AddToEmbeddedBinaries", "true"); importer.SaveAndReimport(); } else { Debug.LogFormat("{0} already set AddToEmbeddedBinaries.", filePath); } } }
private void CopyNativePlugins() { string buildTargetName = BuildPipeline.GetBuildTargetName(this.m_PostProcessArgs.target); IPluginImporterExtension pluginImporterExtension = new DesktopPluginImporterExtension(); string stagingAreaPluginsFolder = this.StagingAreaPluginsFolder; string path = Path.Combine(stagingAreaPluginsFolder, "x86"); string path2 = Path.Combine(stagingAreaPluginsFolder, "x86_64"); bool flag = false; bool flag2 = false; bool flag3 = false; PluginImporter[] importers = PluginImporter.GetImporters(this.m_PostProcessArgs.target); for (int i = 0; i < importers.Length; i++) { PluginImporter pluginImporter = importers[i]; BuildTarget target = this.m_PostProcessArgs.target; if (pluginImporter.isNativePlugin) { if (string.IsNullOrEmpty(pluginImporter.assetPath)) { Debug.LogWarning("Got empty plugin importer path for " + this.m_PostProcessArgs.target.ToString()); } else { if (!flag) { Directory.CreateDirectory(stagingAreaPluginsFolder); flag = true; } bool flag4 = Directory.Exists(pluginImporter.assetPath); string platformData = pluginImporter.GetPlatformData(target, "CPU"); string text = platformData; switch (text) { case "x86": if (target == BuildTarget.StandaloneOSXIntel64 || target == BuildTarget.StandaloneWindows64 || target == BuildTarget.StandaloneLinux64) { goto IL_22F; } if (!flag2) { Directory.CreateDirectory(path); flag2 = true; } break; case "x86_64": if (target != BuildTarget.StandaloneOSXIntel64 && target != BuildTarget.StandaloneOSXUniversal && target != BuildTarget.StandaloneWindows64 && target != BuildTarget.StandaloneLinux64 && target != BuildTarget.StandaloneLinuxUniversal) { goto IL_22F; } if (!flag3) { Directory.CreateDirectory(path2); flag3 = true; } break; case "None": goto IL_22F; } string text2 = pluginImporterExtension.CalculateFinalPluginPath(buildTargetName, pluginImporter); if (!string.IsNullOrEmpty(text2)) { string text3 = Path.Combine(stagingAreaPluginsFolder, text2); if (flag4) { FileUtil.CopyDirectoryRecursive(pluginImporter.assetPath, text3); } else { FileUtil.UnityFileCopy(pluginImporter.assetPath, text3); } } } } IL_22F :; } foreach (PluginDesc current in PluginImporter.GetExtensionPlugins(this.m_PostProcessArgs.target)) { if (!flag) { Directory.CreateDirectory(stagingAreaPluginsFolder); flag = true; } string text4 = Path.Combine(stagingAreaPluginsFolder, Path.GetFileName(current.pluginPath)); if (!Directory.Exists(text4) && !File.Exists(text4)) { if (Directory.Exists(current.pluginPath)) { FileUtil.CopyDirectoryRecursive(current.pluginPath, text4); } else { FileUtil.CopyFileIfExists(current.pluginPath, text4, false); } } } }
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { #region iOS and tvOS { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/tvOS/GameAnalyticsTVOS.h") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.tvOS) || importer.GetCompatibleWithPlatform(BuildTarget.iOS))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, true); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/tvOS/GameAnalyticsTVOSUnity.m") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.tvOS) || importer.GetCompatibleWithPlatform(BuildTarget.iOS))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, true); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/tvOS/libGameAnalyticsTVOS.a") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.tvOS) || importer.GetCompatibleWithPlatform(BuildTarget.iOS))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, true); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } #endregion // iOS and tvOS #region General { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/GameAnalytics.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneLinux) || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneLinux64) || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal) || #if UNITY_2017_3_OR_NEWER !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneOSX) || #else !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel) || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64) || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal) || #endif !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneWindows) || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneWindows64) || !importer.GetCompatibleWithPlatform(BuildTarget.WSAPlayer) || !importer.GetPlatformData(BuildTarget.WSAPlayer, "SDK").Equals("UWP") || !importer.GetPlatformData(BuildTarget.WSAPlayer, "ScriptingBackend").Equals("Il2Cpp"))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, true); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, true); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, true); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, true); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, true); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, true); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, true); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, true); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, true); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.Tizen, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true); importer.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP"); importer.SetPlatformData(BuildTarget.WSAPlayer, "ScriptingBackend", "Il2Cpp"); importer.SaveAndReimport(); } } #endregion // General #region Standalone { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/Windows/x86/sqlite3.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneWindows))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, true); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/Windows/x64/sqlite3.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneWindows64))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, true); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/Linux/sqlite3.so") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneLinux) || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneLinux64) || !importer.GetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, true); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, true); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, true); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } #endregion // Standalone #region WebGL { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WebGL/GameAnalytics.WebGL.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WebGL))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, true); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WebGL/HandleIO.jslib") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WebGL))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, true); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WebGL/Mono.Data.Sqlite.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WebGL))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, true); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WebGL/sqlite.c") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WebGL))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, true); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WebGL/sqlite.h") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WebGL))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, true); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false); importer.SaveAndReimport(); } } #endregion // WebGL #region WSA { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WSA/GameAnalytics.UWP.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WSAPlayer) || !importer.GetPlatformData(BuildTarget.WSAPlayer, "SDK").Equals("UWP") || !importer.GetPlatformData(BuildTarget.WSAPlayer, "ScriptingBackend").Equals("DotNet"))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true); importer.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP"); importer.SetPlatformData(BuildTarget.WSAPlayer, "ScriptingBackend", "DotNet"); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WSA/Microsoft.Data.Sqlite.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WSAPlayer) || !importer.GetPlatformData(BuildTarget.WSAPlayer, "SDK").Equals("UWP"))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true); importer.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP"); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WSA/MetroLog.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WSAPlayer) || !importer.GetPlatformData(BuildTarget.WSAPlayer, "SDK").Equals("AnySDK"))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true); importer.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "AnySDK"); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WSA/x86/sqlite3.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WSAPlayer) || !importer.GetPlatformData(BuildTarget.WSAPlayer, "SDK").Equals("UWP") || !importer.GetPlatformData(BuildTarget.WSAPlayer, "CPU").Equals("X86"))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true); importer.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP"); importer.SetPlatformData(BuildTarget.WSAPlayer, "CPU", "X86"); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WSA/x64/sqlite3.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WSAPlayer) || !importer.GetPlatformData(BuildTarget.WSAPlayer, "SDK").Equals("UWP") || !importer.GetPlatformData(BuildTarget.WSAPlayer, "CPU").Equals("X64"))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true); importer.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP"); importer.SetPlatformData(BuildTarget.WSAPlayer, "CPU", "X64"); importer.SaveAndReimport(); } } { PluginImporter importer = AssetImporter.GetAtPath("Assets/GameAnalytics/Plugins/WSA/ARM/sqlite3.dll") as PluginImporter; if (importer != null && (importer.GetCompatibleWithAnyPlatform() || !importer.GetCompatibleWithPlatform(BuildTarget.WSAPlayer) || !importer.GetPlatformData(BuildTarget.WSAPlayer, "SDK").Equals("UWP") || !importer.GetPlatformData(BuildTarget.WSAPlayer, "CPU").Equals("ARM"))) { importer.SetCompatibleWithAnyPlatform(false); importer.SetCompatibleWithEditor(false); importer.SetCompatibleWithPlatform(BuildTarget.Android, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false); #if UNITY_2017_3_OR_NEWER importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false); #else importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false); #endif importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false); importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false); importer.SetCompatibleWithPlatform(BuildTarget.iOS, false); importer.SetCompatibleWithPlatform(BuildTarget.tvOS, false); importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false); importer.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true); importer.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP"); importer.SetPlatformData(BuildTarget.WSAPlayer, "CPU", "ARM"); importer.SaveAndReimport(); } } #endregion // WSA }
private static bool IsSDK(this PluginImporter imp, string sdk) => (string.Compare(imp.GetPlatformData(platformName, Plugin.sdkTag), sdk) == 0);
private static bool IsCPUArchitecture(this PluginImporter imp, string cpu) => (string.Compare(imp.GetPlatformData(platformName, Plugin.cpuTag), cpu) == 0);