Ejemplo n.º 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);
             }
         }
     }
 }
Ejemplo n.º 2
0
	static bool SetCompatibleWithPlatform(PluginImporter plugin, BuildTarget platform, bool enable) {
		if (plugin.GetCompatibleWithPlatform(platform) == enable) {
			return false;
		}

		plugin.SetCompatibleWithPlatform(platform, enable);
		return true;
	}
 static void SetCompatiblePlatforms(PluginImporter pluginImporter, IEnumerable<BuildTarget> platforms)
 {
     foreach (var platform in platforms)
     {
         pluginImporter.SetCompatibleWithPlatform(platform, true);
     }
 }
        static void FixPlayMakerMetroPluginSettings(PluginImporter pluginImporter)
        {
            LogChange("Fixed Plugin Settings: " + pluginImporter.assetPath);

            pluginImporter.SetCompatibleWithAnyPlatform(false);
            pluginImporter.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true);
            AssetDatabase.Refresh();
        }