Beispiel #1
0
 internal override void Apply()
 {
     base.Apply();
     PluginImporter[] importers = this.importers;
     for (int i = 0; i < importers.Length; i++)
     {
         PluginImporter pluginImporter = importers[i];
         if (this.m_CompatibleWithAnyPlatform > PluginImporterInspector.Compatibility.Mixed)
         {
             pluginImporter.SetCompatibleWithAnyPlatform(this.m_CompatibleWithAnyPlatform == PluginImporterInspector.Compatibility.Compatible);
         }
         if (this.m_CompatibleWithEditor > PluginImporterInspector.Compatibility.Mixed)
         {
             pluginImporter.SetCompatibleWithEditor(this.m_CompatibleWithEditor == PluginImporterInspector.Compatibility.Compatible);
         }
         foreach (BuildTarget current in PluginImporterInspector.GetValidBuildTargets())
         {
             if (this.m_CompatibleWithPlatform[(int)current] > PluginImporterInspector.Compatibility.Mixed)
             {
                 pluginImporter.SetCompatibleWithPlatform(current, this.m_CompatibleWithPlatform[(int)current] == PluginImporterInspector.Compatibility.Compatible);
             }
         }
         if (this.m_CompatibleWithEditor > PluginImporterInspector.Compatibility.Mixed)
         {
             pluginImporter.SetExcludeEditorFromAnyPlatform(this.m_CompatibleWithEditor == PluginImporterInspector.Compatibility.NotCompatible);
         }
         foreach (BuildTarget current2 in PluginImporterInspector.GetValidBuildTargets())
         {
             if (this.m_CompatibleWithPlatform[(int)current2] > PluginImporterInspector.Compatibility.Mixed)
             {
                 pluginImporter.SetExcludeFromAnyPlatform(current2, this.m_CompatibleWithPlatform[(int)current2] == PluginImporterInspector.Compatibility.NotCompatible);
             }
         }
     }
     if (this.IsEditingPlatformSettingsSupported())
     {
         IPluginImporterExtension[] additionalExtensions = this.additionalExtensions;
         for (int j = 0; j < additionalExtensions.Length; j++)
         {
             IPluginImporterExtension pluginImporterExtension = additionalExtensions[j];
             pluginImporterExtension.Apply(this);
         }
         foreach (BuildTarget current3 in PluginImporterInspector.GetValidBuildTargets())
         {
             IPluginImporterExtension pluginImporterExtension2 = ModuleManager.GetPluginImporterExtension(current3);
             if (pluginImporterExtension2 != null)
             {
                 pluginImporterExtension2.Apply(this);
             }
         }
     }
 }
	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;
	}
        static void FixPlayMakerMetroPluginSettings(PluginImporter pluginImporter)
        {
            LogChange("Fixed Plugin Settings: " + pluginImporter.assetPath);

            pluginImporter.SetCompatibleWithAnyPlatform(false);
            pluginImporter.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true);
            AssetDatabase.Refresh();
        }
        static void FixPlayMakerPluginSettings(PluginImporter pluginImporter)
        {
            LogChange("Fixed Plugin Settings: " + pluginImporter.assetPath);

            pluginImporter.SetCompatibleWithAnyPlatform(false);
            pluginImporter.SetCompatibleWithEditor(true);
            SetCompatiblePlatforms(pluginImporter, standardPlatforms);
            AssetDatabase.Refresh();
        }