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);
    }
Beispiel #2
0
 private static void SetPluginCompatibleIdp(BuildTarget target, string path, bool enable)
 {
     //			if (File.Exists (path) == true || Directory.Exists (path) == true) {
     //				FileAttributes attr = File.GetAttributes (path);
     //				string[] pathSplit = path.Split ('/');
     //				string name = pathSplit [pathSplit.Length - 1];
     //				if ((attr & FileAttributes.Directory) == FileAttributes.Directory && name.Contains (".") == false) {
     //					Debug.LogError ("directory : " + path);
     //					string[] directoryPaths = Directory.GetDirectories (path, "*", SearchOption.TopDirectoryOnly);
     //					foreach (string directoryPath in directoryPaths) {
     //						SetPluginCompatibleIdp (target, directoryPath, enable);
     //					}
     //				} else {
     //					Debug.LogError ("file : " + path);
     if (File.Exists(path) == true || Directory.Exists(path) == true)
     {
         PluginImporter pluginImporter = PluginImporter.GetAtPath(path) as PluginImporter;
         if (pluginImporter != null)
         {
             if (pluginImporter.GetCompatibleWithAnyPlatform() == true)
             {
                 pluginImporter.SetCompatibleWithAnyPlatform(false);
             }
             if (pluginImporter.GetCompatibleWithPlatform(target) != enable)
             {
                 pluginImporter.SetCompatibleWithPlatform(target, enable);
                 pluginImporter.SaveAndReimport();
             }
         }
     }
     //				}
     //			}
 }
 private static void SetCompatibleWithAnyPlatform(PluginImporter pluginImporter, bool enable)
 {
     if (pluginImporter.GetCompatibleWithAnyPlatform() != enable)
     {
         pluginImporter.SetCompatibleWithAnyPlatform(enable);
         mHasAtLeastOneLibraryBeenModified = true;
     }
 }
        internal bool UpdateCompatibleWithAnyPlatform(PluginImporter pluginImporter)
        {
            if (CompatibleWithAnyPlatform != pluginImporter.GetCompatibleWithAnyPlatform())
            {
                pluginImporter.SetCompatibleWithAnyPlatform(CompatibleWithAnyPlatform);
                return(true);
            }

            return(false);
        }
Beispiel #5
0
 void _SetCompatibleWithAnyPlatform(bool enable)
 {
     if (_pluginImporter != null)
     {
         if (_pluginImporter.GetCompatibleWithAnyPlatform() != enable)
         {
             _pluginImporter.SetCompatibleWithAnyPlatform(enable);
             _isWritten = true;
         }
     }
 }
Beispiel #6
0
    public static bool IsSdkDllActive(SdkVersion version)
    {
        string         assembly = version.ToString();
        PluginImporter importer = AssetImporter.GetAtPath("Assets/VRCSDK/Plugins/" + assembly + ".dll") as PluginImporter;

        if (importer == false)
        {
            return(false);
        }
        return(importer.GetCompatibleWithAnyPlatform());
    }
Beispiel #7
0
        /// <summary>
        /// Returns true if the plugin importer already has the correct settings, otherwise returns false. If
        /// false is returned, the plugin settings should be reset to their expected values.
        /// </summary>
        /// <param name="pluginImporter"></param>
        /// <param name="isCompatibleWithAnyPlatform"></param>
        /// <param name="isCompatibleWithEditor"></param>
        /// <param name="editorPlatform"></param>
        /// <param name="allowedRuntimePlatforms"></param>
        /// <returns></returns>
        private static bool HasCorrectImportSettings(
            PluginImporter pluginImporter,
            bool isCompatibleWithAnyPlatform,
            bool isCompatibleWithEditor,
            EditorOS editorPlatform,
            params BuildTarget[] allowedRuntimePlatforms)
        {
            // Return false if our platform compatibility doesn't match
            if (pluginImporter.GetCompatibleWithAnyPlatform() != isCompatibleWithAnyPlatform)
            {
                return(false);
            }

            // Return false if our editor compatibility doesn't match
            if (pluginImporter.GetCompatibleWithEditor() != isCompatibleWithEditor)
            {
                return(false);
            }

            // If the plugin is compatible with the editor and not set to the proper platform or to the proper
            // CPU level, return false.
            if (pluginImporter.GetCompatibleWithEditor() && isCompatibleWithEditor)
            {
                var editorPlatformValue = pluginImporter.GetEditorData(OS_KEY);
                var editorOS            = (EditorOS)Enum.Parse(typeof(EditorOS), editorPlatformValue);
                if (editorOS != editorPlatform)
                {
                    return(false);
                }

                if (pluginImporter.GetEditorData(CPU_KEY) != CPU_VALUE)
                {
                    return(false);
                }
            }

            // Check compatibility with each platform and verify that we have correct setting for each.
            foreach (var buildTarget in ALL_BUILD_TARGETS)
            {
                var shouldBeCompatible = allowedRuntimePlatforms.Contains(buildTarget);
                var isCompatible       = pluginImporter.GetCompatibleWithPlatform(buildTarget);

                if (shouldBeCompatible && !isCompatible)
                {
                    return(false);
                }
                else if (!shouldBeCompatible && isCompatible)
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #8
0
 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();
             }
         }
     }
 }
Beispiel #9
0
        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
        }
    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());
    }
Beispiel #11
0
        private FixProblemInstruction checkAndGetInstruction(string relativePath, platforms platform)
        {
            EnablePluginForPlatform instr = null;
            PluginImporter          imp   = AssetImporter.GetAtPath(relativePath) as PluginImporter;

            if (imp == null)
            {
                return(instr);
            }
            bool isChecked = false;

            switch (platform)
            {
            case platforms.any:
                isChecked = imp.GetCompatibleWithAnyPlatform();
                break;

            case platforms.editor:
                isChecked = imp.GetCompatibleWithEditor();
                break;

            case platforms.android:
                isChecked = imp.GetCompatibleWithPlatform(BuildTarget.Android);
                break;

            case platforms.ios:
                isChecked = imp.GetCompatibleWithPlatform(BuildTarget.iOS);
                break;
            }

            if (!isChecked)
            {
                string desc = "Plugin " + relativePath + " should be enabled for platform: " + platform.ToString() +
                              ".\n";
                if (relativePath.Contains(AppodealUnityUtils.combinePaths("Assets", "Plugins", "Android")))
                {
                    desc +=
                        "If you wan't to exclude this network from your game, don't forget to add Appodeal.disableNetwork(networkname) before initialization.";
                }
                instr = new EnablePluginForPlatform(desc, true, relativePath, platform);
            }

            return(instr);
        }
Beispiel #12
0
        private static bool HasCompatibility(string pathToDLL, BuildTarget[] supportedBuildTargets, bool isCompatibleWithEditor)
        {
            PluginImporter pluginImporter = (PluginImporter)AssetImporter.GetAtPath(pathToDLL);

            // check if any platform is enabled
            if (pluginImporter.GetCompatibleWithAnyPlatform())
            {
                return(false);
            }

            // check if compatible with editor if that is desired
            if (pluginImporter.GetCompatibleWithEditor() != isCompatibleWithEditor)
            {
                return(false);
            }

            // check for each build target if compatible when desired
            foreach (BuildTarget buildTarget in Enum.GetValues(typeof(BuildTarget)))
            {
                if (IsBuildTargetObsolete(buildTarget) || buildTarget == BuildTarget.NoTarget)
                {
                    continue;;
                }

                bool isCompatible = pluginImporter.GetCompatibleWithPlatform(buildTarget);

                if (supportedBuildTargets.Contains(buildTarget))
                {
                    if (!isCompatible)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (isCompatible)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Beispiel #13
0
    static void SetDLLPlatforms(string dllName, bool active)
    {
        string[] assetGuids = AssetDatabase.FindAssets(dllName);

        foreach (string guid in assetGuids)
        {
            string dllPath = AssetDatabase.GUIDToAssetPath(guid);
            if (string.IsNullOrEmpty(dllPath) || dllPath.ToLower().EndsWith(".dll") == false)
            {
                return;
            }

            PluginImporter importer = AssetImporter.GetAtPath(dllPath) as PluginImporter;

            bool allCorrect = true;
            if (importer.GetCompatibleWithAnyPlatform() != active)
            {
                allCorrect = false;
            }
            else
            {
                if (importer.GetCompatibleWithAnyPlatform())
                {
                    if (importer.GetExcludeEditorFromAnyPlatform() != !active ||
                        importer.GetExcludeFromAnyPlatform(BuildTarget.StandaloneWindows) != !active)
                    {
                        allCorrect = false;
                    }
                }
                else
                {
                    if (importer.GetCompatibleWithEditor() != active ||
                        importer.GetCompatibleWithPlatform(BuildTarget.StandaloneWindows) != active)
                    {
                        allCorrect = false;
                    }
                }
            }

            if (allCorrect == false)
            {
                if (active)
                {
                    importer.SetCompatibleWithAnyPlatform(true);
                    importer.SetExcludeEditorFromAnyPlatform(false);
                    importer.SetExcludeFromAnyPlatform(BuildTarget.Android, false);
                    importer.SetExcludeFromAnyPlatform(BuildTarget.StandaloneWindows, false);
                    importer.SetExcludeFromAnyPlatform(BuildTarget.StandaloneWindows64, false);
                    importer.SetExcludeFromAnyPlatform(BuildTarget.StandaloneLinux64, false);
                }
                else
                {
                    importer.SetCompatibleWithAnyPlatform(false);
                    importer.SetCompatibleWithEditor(false);
                    importer.SetCompatibleWithPlatform(BuildTarget.Android, false);
                    importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false);
                    importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false);
                    importer.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false);
                }
                importer.SaveAndReimport();
            }
        }
    }
Beispiel #14
0
 static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
 {
     // Fix for wrong tvOS platform imports
     {
         PluginImporter importer = AssetImporter.GetAtPath("Assets/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);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false);
             importer.SetCompatibleWithPlatform(BuildTarget.WebPlayer, false);
             importer.SetCompatibleWithPlatform(BuildTarget.WebPlayerStreamed, false);
             importer.SetCompatibleWithPlatform(BuildTarget.iOS, false);
             importer.SetCompatibleWithPlatform(BuildTarget.tvOS, true);
             importer.SaveAndReimport();
         }
     }
     {
         PluginImporter importer = AssetImporter.GetAtPath("Assets/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);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false);
             importer.SetCompatibleWithPlatform(BuildTarget.WebPlayer, false);
             importer.SetCompatibleWithPlatform(BuildTarget.WebPlayerStreamed, false);
             importer.SetCompatibleWithPlatform(BuildTarget.iOS, false);
             importer.SetCompatibleWithPlatform(BuildTarget.tvOS, true);
             importer.SaveAndReimport();
         }
     }
     {
         PluginImporter importer = AssetImporter.GetAtPath("Assets/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);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false);
             importer.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false);
             importer.SetCompatibleWithPlatform(BuildTarget.WebPlayer, false);
             importer.SetCompatibleWithPlatform(BuildTarget.WebPlayerStreamed, false);
             importer.SetCompatibleWithPlatform(BuildTarget.iOS, false);
             importer.SetCompatibleWithPlatform(BuildTarget.tvOS, true);
             importer.SaveAndReimport();
         }
     }
 }
Beispiel #15
0
        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
        }
        public static void PreferencesGUI()
        {
//			Event.current.GetTypeForControl
//
//			if(Event.current.type == EventType.KeyDown)
//			{
//				cachedEvent = new Event(Event.current);
////				this.Repaint();
//			}
//
//			GUILayout.TextField("");
//
//			if(cachedEvent != null)
//			{
//				GUILayout.Label(cachedEvent.ToString());
//			}
//			else
//			{
//				GUILayout.Label("No event");
//			}



            GUILayout.Space(10);

            bool newHideGridInPerspective = GUILayout.Toggle(CurrentSettings.HideGridInPerspective, "Hide grid in perspective scene views");

            if (newHideGridInPerspective != CurrentSettings.HideGridInPerspective)
            {
                SceneView.RepaintAll();
                CurrentSettings.HideGridInPerspective = newHideGridInPerspective;
            }


            CurrentSettings.OverrideFlyCamera    = GUILayout.Toggle(CurrentSettings.OverrideFlyCamera, "Linear fly camera");
            CurrentSettings.ShowExcludedPolygons = GUILayout.Toggle(CurrentSettings.ShowExcludedPolygons, "Show excluded polygons");

            GUILayout.Space(10);

            if (GUILayout.Button("Change key mappings"))
            {
                Selection.activeObject = KeyMappings.Instance;
                // Show inspector
                EditorApplication.ExecuteMenuItem("Window/Inspector");
            }
//			CurrentSettings.ReducedHandleThreshold = GUILayout.Toggle(CurrentSettings.ReducedHandleThreshold, "Reduced handle threshold");

            GUILayout.Space(20);
            PluginImporter plugin = GetPluginImporter();

            GUIStyle style = SabreGUILayout.GetForeStyle();

            style.wordWrap = true;
            GUILayout.Label("Runtime CSG is a new experimental feature which allows you to create, alter and build brushes at runtime in your built applications.", style);
            BuildTargetGroup buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup;
            string           defines          = PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup);
            List <string>    definesSplit     = defines.Split(';').ToList();
            bool             enabled          = definesSplit.Contains(RUNTIME_CSG_DEFINE);

            if (plugin != null)
            {
                if (!plugin.GetCompatibleWithAnyPlatform())
                {
                    enabled = false;
                }
            }

            if (enabled)
            {
                if (GUILayout.Button("Disable Runtime CSG (Experimental)"))
                {
                    definesSplit.Remove(RUNTIME_CSG_DEFINE);
                    defines = string.Join(";", definesSplit.ToArray());
                    PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, defines);

                    if (plugin != null)
                    {
                        // Set plugin as only compatible with editor
                        plugin.SetCompatibleWithAnyPlatform(false);
                        plugin.SetCompatibleWithEditor(true);
                        // Reimport the plugin
                        string path = GetPluginPath();
                        AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
                    }
                }
            }
            else
            {
                if (GUILayout.Button("Enable Runtime CSG (Experimental)"))
                {
                    if (!definesSplit.Contains(RUNTIME_CSG_DEFINE))
                    {
                        definesSplit.Add(RUNTIME_CSG_DEFINE);
                    }
                    defines = string.Join(";", definesSplit.ToArray());
                    PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, defines);

                    if (plugin != null)
                    {
                        // Set plugin as compatible with all platforms
                        plugin.SetCompatibleWithAnyPlatform(true);
                        // Reimport the plugin
                        string path = GetPluginPath();
                        AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
                    }
                }
            }


            GUILayout.FlexibleSpace();

            GUILayout.Label("SabreCSG Version " + CSGModel.VERSION_STRING, SabreGUILayout.GetForeStyle());
        }