private void ShowGeneralOptions() { EditorGUI.BeginChangeCheck(); this.m_CompatibleWithAnyPlatform = this.ToggleWithMixedValue(this.m_CompatibleWithAnyPlatform, "Any Platform"); EditorGUI.BeginDisabledGroup(this.m_CompatibleWithAnyPlatform == 1); this.m_CompatibleWithEditor = this.ToggleWithMixedValue(this.m_CompatibleWithEditor, "Editor"); EditorGUI.BeginChangeCheck(); int num = this.ToggleWithMixedValue(this.compatibleWithStandalone, "Standalone"); if (EditorGUI.EndChangeCheck()) { this.compatibleWithStandalone = num; this.m_DesktopExtension.ValidateSingleCPUTargets(this); } using (List <BuildTarget> .Enumerator enumerator = PluginImporterInspector.GetValidBuildTargets().GetEnumerator()) { while (enumerator.MoveNext()) { BuildTarget current = enumerator.Current; if (!PluginImporterInspector.IsStandaloneTarget(current)) { this.m_CompatibleWithPlatform[(int)current] = this.ToggleWithMixedValue(this.m_CompatibleWithPlatform[(int)current], current.ToString()); } } } EditorGUI.EndDisabledGroup(); if (!EditorGUI.EndChangeCheck()) { return; } this.m_HasModified = true; }
private void ShowGeneralOptions() { EditorGUI.BeginChangeCheck(); this.m_CompatibleWithAnyPlatform = this.ToggleWithMixedValue(this.m_CompatibleWithAnyPlatform, "Any Platform"); using (new EditorGUI.DisabledScope(this.m_CompatibleWithAnyPlatform == 1)) { this.m_CompatibleWithEditor = this.ToggleWithMixedValue(this.m_CompatibleWithEditor, "Editor"); EditorGUI.BeginChangeCheck(); int compatibleWithStandalone = this.ToggleWithMixedValue(this.compatibleWithStandalone, "Standalone"); if (EditorGUI.EndChangeCheck()) { this.compatibleWithStandalone = compatibleWithStandalone; this.m_DesktopExtension.ValidateSingleCPUTargets(this); } foreach (BuildTarget current in PluginImporterInspector.GetValidBuildTargets()) { if (!PluginImporterInspector.IsStandaloneTarget(current)) { this.m_CompatibleWithPlatform[(int)current] = this.ToggleWithMixedValue(this.m_CompatibleWithPlatform[(int)current], current.ToString()); } } } if (EditorGUI.EndChangeCheck()) { this.m_HasModified = true; } }
private void ShowGeneralOptions() { EditorGUI.BeginChangeCheck(); this.compatibleWithAnyPlatform = GUILayout.Toggle(this.compatibleWithAnyPlatform, "Any Platform", new GUILayoutOption[0]); EditorGUI.BeginDisabledGroup(this.compatibleWithAnyPlatform); this.compatibleWithEditor = GUILayout.Toggle(this.compatibleWithEditor, "Editor", new GUILayoutOption[0]); this.compatibleWithStandalone = GUILayout.Toggle(this.compatibleWithStandalone, "Standalone", new GUILayoutOption[0]); foreach (BuildTarget current in PluginImporterInspector.GetValidBuildTargets()) { if (!PluginImporterInspector.IsStandaloneTarget(current)) { this.compatibleWithPlatform[(int)current] = GUILayout.Toggle(this.compatibleWithPlatform[(int)current], current.ToString(), new GUILayoutOption[0]); } } EditorGUI.EndDisabledGroup(); if (EditorGUI.EndChangeCheck()) { this.hasModified = true; } }
private void ShowPlatforms(PluginImporterInspector.ValueSwitcher switcher) { this.m_CompatibleWithEditor = switcher(this.ToggleWithMixedValue(switcher(this.m_CompatibleWithEditor), "Editor")); EditorGUI.BeginChangeCheck(); PluginImporterInspector.Compatibility value = this.ToggleWithMixedValue(switcher(this.compatibleWithStandalone), "Standalone"); if (EditorGUI.EndChangeCheck()) { this.compatibleWithStandalone = switcher(value); if (this.compatibleWithStandalone != PluginImporterInspector.Compatibility.Mixed) { this.desktopExtension.ValidateSingleCPUTargets(this); } } foreach (BuildTarget current in PluginImporterInspector.GetValidBuildTargets()) { if (!PluginImporterInspector.IsStandaloneTarget(current)) { this.m_CompatibleWithPlatform[(int)current] = switcher(this.ToggleWithMixedValue(switcher(this.m_CompatibleWithPlatform[(int)current]), current.ToString())); } } }
private static List <BuildTarget> GetValidBuildTargets() { List <BuildTarget> list = new List <BuildTarget>(); using (List <Enum> .Enumerator enumerator = typeof(BuildTarget).EnumGetNonObsoleteValues().GetEnumerator()) { while (enumerator.MoveNext()) { BuildTarget buildTarget = (BuildTarget)enumerator.Current; if (buildTarget > (BuildTarget)0) { if (!PluginImporterInspector.IgnorePlatform(buildTarget)) { if (!ModuleManager.IsPlatformSupported(buildTarget) || ModuleManager.IsPlatformSupportLoaded(ModuleManager.GetTargetStringFromBuildTarget(buildTarget)) || PluginImporterInspector.IsStandaloneTarget(buildTarget)) { list.Add(buildTarget); } } } } } return(list); }