Inheritance: EditorWindow
Beispiel #1
0
 private void WriteSettingsToBackend()
 {
     if (this.m_TargetSettings != null)
     {
         List <BuildPlayerWindow.BuildPlatform> validPlatforms = BuildPlayerWindow.GetValidPlatforms();
         for (int i = 0; i < base.targets.Length; i++)
         {
             VideoClipImporter videoClipImporter = (VideoClipImporter)base.targets[i];
             videoClipImporter.defaultTargetSettings = this.m_TargetSettings[i, 0].settings;
             for (int j = 1; j < validPlatforms.Count + 1; j++)
             {
                 BuildTargetGroup targetGroup = validPlatforms[j - 1].targetGroup;
                 if (this.m_TargetSettings[i, j].settings != null && this.m_TargetSettings[i, j].overridePlatform)
                 {
                     videoClipImporter.Internal_SetTargetSettings(targetGroup, this.m_TargetSettings[i, j].settings);
                 }
                 else
                 {
                     videoClipImporter.Internal_ClearTargetSettings(targetGroup);
                 }
             }
         }
     }
     this.m_ModifiedTargetSettings = false;
 }
 public void OnEnable()
 {
     this.m_QualitySettings                   = new SerializedObject(base.target);
     this.m_QualitySettingsProperty           = this.m_QualitySettings.FindProperty("m_QualitySettings");
     this.m_PerPlatformDefaultQualityProperty = this.m_QualitySettings.FindProperty("m_PerPlatformDefaultQuality");
     this.m_ValidPlatforms = BuildPlayerWindow.GetValidPlatforms();
 }
Beispiel #3
0
        private BuildPlayerWindow.BuildPlatform[] GetBuildPlayerValidPlatforms()
        {
            List <BuildPlayerWindow.BuildPlatform> validPlatforms = BuildPlayerWindow.GetValidPlatforms();
            List <BuildPlayerWindow.BuildPlatform> list2          = new List <BuildPlayerWindow.BuildPlatform>();

            if (this.m_CompatibleWithEditor > Compatibility.NotCompatible)
            {
                BuildPlayerWindow.BuildPlatform item = new BuildPlayerWindow.BuildPlatform("Editor settings", "Editor Settings", "BuildSettings.Editor", BuildTargetGroup.Unknown, true)
                {
                    name = BuildPipeline.GetEditorTargetName()
                };
                list2.Add(item);
            }
            foreach (BuildPlayerWindow.BuildPlatform platform2 in validPlatforms)
            {
                if (!IgnorePlatform(platform2.DefaultTarget))
                {
                    if (platform2.targetGroup == BuildTargetGroup.Standalone)
                    {
                        if (this.compatibleWithStandalone < Compatibility.Compatible)
                        {
                            continue;
                        }
                    }
                    else if ((this.m_CompatibleWithPlatform[(int)platform2.DefaultTarget] < Compatibility.Compatible) || (ModuleManager.GetPluginImporterExtension(platform2.targetGroup) == null))
                    {
                        continue;
                    }
                    list2.Add(platform2);
                }
            }
            return(list2.ToArray());
        }
Beispiel #4
0
        private void OnTargetsInspectorGUI()
        {
            BuildPlayerWindow.BuildPlatform[] array = BuildPlayerWindow.GetValidPlatforms().ToArray();
            int    num          = EditorGUILayout.BeginPlatformGrouping(array, GUIContent.Temp("Default"));
            string platformName = (num != -1) ? array[num].name : "Default";

            this.OnTargetInspectorGUI(num + 1, platformName);
            EditorGUILayout.EndPlatformGrouping();
        }
Beispiel #5
0
            public override void OnInspectorGUI()
            {
                BuildPlayerWindow.BuildPlatform[] array = BuildPlayerWindow.GetValidPlatforms().ToArray();
                BuildTargetGroup targetGroup            = array[EditorGUILayout.BeginPlatformGrouping(array, null, GUIStyle.none)].targetGroup;

                if (this.verticalLayout)
                {
                    this.OnGuiVertical(targetGroup);
                }
                else
                {
                    this.OnGuiHorizontal(targetGroup);
                }
                EditorGUILayout.EndPlatformGrouping();
            }
        /// <summary>
        /// <para>TODO.</para>
        /// </summary>
        /// <param name="platform"></param>
        public TextureImporterFormat GetAutomaticFormat(string platform)
        {
            TextureImporterSettings dest = new TextureImporterSettings();

            this.ReadTextureSettings(dest);
            TextureImporterPlatformSettings        platformTextureSettings = this.GetPlatformTextureSettings(platform);
            List <BuildPlayerWindow.BuildPlatform> validPlatforms          = BuildPlayerWindow.GetValidPlatforms();

            foreach (BuildPlayerWindow.BuildPlatform platform2 in validPlatforms)
            {
                if (platform2.name == platform)
                {
                    return(FormatFromTextureParameters(dest, platformTextureSettings, this.DoesSourceTextureHaveAlpha(), this.IsSourceTextureHDR(), platform2.DefaultTarget));
                }
            }
            return(TextureImporterFormat.Automatic);
        }
        private void OnAudioImporterGUI(bool selectionContainsTrackerFile)
        {
            if (!selectionContainsTrackerFile)
            {
                EditorGUILayout.PropertyField(this.m_ForceToMono);
                ++EditorGUI.indentLevel;
                EditorGUI.BeginDisabledGroup(!this.m_ForceToMono.boolValue);
                EditorGUILayout.PropertyField(this.m_Normalize);
                EditorGUI.EndDisabledGroup();
                --EditorGUI.indentLevel;
                EditorGUILayout.PropertyField(this.m_LoadInBackground);
            }
            BuildPlayerWindow.BuildPlatform[] array = BuildPlayerWindow.GetValidPlatforms().ToArray();
            GUILayout.Space(10f);
            int index = EditorGUILayout.BeginPlatformGrouping(array, GUIContent.Temp("Default"));

            if (index == -1)
            {
                bool disablePreloadAudioDataOption = this.m_DefaultSampleSettings.settings.loadType == AudioClipLoadType.Streaming;
                this.OnSampleSettingGUI(BuildTargetGroup.Unknown, this.GetMultiValueStatus(BuildTargetGroup.Unknown), selectionContainsTrackerFile, ref this.m_DefaultSampleSettings, disablePreloadAudioDataOption);
            }
            else
            {
                BuildTargetGroup targetGroup = array[index].targetGroup;
                AudioImporterInspector.SampleSettingProperties sampleSettingOverride = this.m_SampleSettingOverrides[targetGroup];
                AudioImporterInspector.OverrideStatus          overrideStatus        = this.GetOverrideStatus(targetGroup);
                EditorGUI.BeginChangeCheck();
                EditorGUI.showMixedValue = overrideStatus == AudioImporterInspector.OverrideStatus.MixedOverrides && !sampleSettingOverride.overrideIsForced;
                bool flag1 = sampleSettingOverride.overrideIsForced && sampleSettingOverride.forcedOverrideState || !sampleSettingOverride.overrideIsForced && overrideStatus != AudioImporterInspector.OverrideStatus.NoOverrides;
                bool flag2 = EditorGUILayout.Toggle("Override for " + array[index].name, flag1, new GUILayoutOption[0]);
                EditorGUI.showMixedValue = false;
                if (EditorGUI.EndChangeCheck())
                {
                    sampleSettingOverride.forcedOverrideState = flag2;
                    sampleSettingOverride.overrideIsForced    = true;
                }
                bool disablePreloadAudioDataOption = (sampleSettingOverride.overrideIsForced && sampleSettingOverride.forcedOverrideState || this.GetOverrideStatus(targetGroup) == AudioImporterInspector.OverrideStatus.AllOverrides) && sampleSettingOverride.settings.loadType == AudioClipLoadType.Streaming;
                AudioImporterInspector.MultiValueStatus multiValueStatus = this.GetMultiValueStatus(targetGroup);
                EditorGUI.BeginDisabledGroup((!sampleSettingOverride.overrideIsForced || !sampleSettingOverride.forcedOverrideState ? (overrideStatus == AudioImporterInspector.OverrideStatus.AllOverrides ? 1 : 0) : 1) == 0);
                this.OnSampleSettingGUI(targetGroup, multiValueStatus, selectionContainsTrackerFile, ref sampleSettingOverride, disablePreloadAudioDataOption);
                EditorGUI.EndDisabledGroup();
                this.m_SampleSettingOverrides[targetGroup] = sampleSettingOverride;
            }
            EditorGUILayout.EndPlatformGrouping();
        }
Beispiel #8
0
        public TextureImporterFormat GetAutomaticFormat(string platform)
        {
            TextureImporterSettings textureImporterSettings = new TextureImporterSettings();

            this.ReadTextureSettings(textureImporterSettings);
            TextureImporterPlatformSettings        platformTextureSettings = this.GetPlatformTextureSettings(platform);
            List <BuildPlayerWindow.BuildPlatform> validPlatforms          = BuildPlayerWindow.GetValidPlatforms();
            TextureImporterFormat result;

            foreach (BuildPlayerWindow.BuildPlatform current in validPlatforms)
            {
                if (current.name == platform)
                {
                    result = TextureImporter.FormatFromTextureParameters(textureImporterSettings, platformTextureSettings, this.DoesSourceTextureHaveAlpha(), this.IsSourceTextureHDR(), current.DefaultTarget);
                    return(result);
                }
            }
            result = TextureImporterFormat.Automatic;
            return(result);
        }
Beispiel #9
0
        private BuildPlayerWindow.BuildPlatform[] GetBuildPlayerValidPlatforms()
        {
            List <BuildPlayerWindow.BuildPlatform> validPlatforms = BuildPlayerWindow.GetValidPlatforms();
            List <BuildPlayerWindow.BuildPlatform> list           = new List <BuildPlayerWindow.BuildPlatform>();

            if (this.m_CompatibleWithEditor > PluginImporterInspector.Compatibility.NotCompatible)
            {
                list.Add(new BuildPlayerWindow.BuildPlatform("Editor settings", "Editor Settings", "BuildSettings.Editor", BuildTargetGroup.Unknown, true)
                {
                    name = BuildPipeline.GetEditorTargetName()
                });
            }
            foreach (BuildPlayerWindow.BuildPlatform current in validPlatforms)
            {
                if (!PluginImporterInspector.IgnorePlatform(current.DefaultTarget))
                {
                    if (current.targetGroup == BuildTargetGroup.Standalone)
                    {
                        if (this.compatibleWithStandalone < PluginImporterInspector.Compatibility.Compatible)
                        {
                            continue;
                        }
                    }
                    else
                    {
                        if (this.m_CompatibleWithPlatform[(int)current.DefaultTarget] < PluginImporterInspector.Compatibility.Compatible)
                        {
                            continue;
                        }
                        if (ModuleManager.GetPluginImporterExtension(current.targetGroup) == null)
                        {
                            continue;
                        }
                    }
                    list.Add(current);
                }
            }
            return(list.ToArray());
        }
Beispiel #10
0
        private BuildPlayerWindow.BuildPlatform[] GetBuildPlayerValidPlatforms()
        {
            List <BuildPlayerWindow.BuildPlatform> validPlatforms    = BuildPlayerWindow.GetValidPlatforms();
            List <BuildPlayerWindow.BuildPlatform> buildPlatformList = new List <BuildPlayerWindow.BuildPlatform>();

            if (this.m_CompatibleWithAnyPlatform > 0 || this.m_CompatibleWithEditor > 0)
            {
                buildPlatformList.Add(new BuildPlayerWindow.BuildPlatform("Editor settings", "BuildSettings.Editor", BuildTargetGroup.Unknown, true)
                {
                    name = BuildPipeline.GetEditorTargetName()
                });
            }
            using (List <BuildPlayerWindow.BuildPlatform> .Enumerator enumerator = validPlatforms.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    BuildPlayerWindow.BuildPlatform current = enumerator.Current;
                    if (!PluginImporterInspector.IgnorePlatform(current.DefaultTarget))
                    {
                        if (current.targetGroup == BuildTargetGroup.Standalone)
                        {
                            if (this.m_CompatibleWithAnyPlatform < 1 && this.compatibleWithStandalone < 1)
                            {
                                continue;
                            }
                        }
                        else if (this.m_CompatibleWithAnyPlatform < 1 && this.m_CompatibleWithPlatform[(int)current.DefaultTarget] < 1 || ModuleManager.GetPluginImporterExtension(current.targetGroup) == null)
                        {
                            continue;
                        }
                        buildPlatformList.Add(current);
                    }
                }
            }
            return(buildPlatformList.ToArray());
        }
        private BuildPlayerWindow.BuildPlatform[] GetBuildPlayerValidPlatforms()
        {
            List <BuildPlayerWindow.BuildPlatform> validPlatforms = BuildPlayerWindow.GetValidPlatforms();
            List <BuildPlayerWindow.BuildPlatform> list2          = new List <BuildPlayerWindow.BuildPlatform>();

            if ((this.m_CompatibleWithAnyPlatform > 0) || (this.m_CompatibleWithEditor > 0))
            {
                BuildPlayerWindow.BuildPlatform item = new BuildPlayerWindow.BuildPlatform("Editor settings", "BuildSettings.Editor", BuildTargetGroup.Unknown, true)
                {
                    name = BuildPipeline.GetEditorTargetName()
                };
                list2.Add(item);
            }
            foreach (BuildPlayerWindow.BuildPlatform platform2 in validPlatforms)
            {
                if (IgnorePlatform(platform2.DefaultTarget))
                {
                    continue;
                }
                if (platform2.targetGroup == BuildTargetGroup.Standalone)
                {
                    if ((this.m_CompatibleWithAnyPlatform >= 1) || (this.compatibleWithStandalone >= 1))
                    {
                        goto Label_00DD;
                    }
                    continue;
                }
                if (((this.m_CompatibleWithAnyPlatform < 1) && (this.m_CompatibleWithPlatform[(int)platform2.DefaultTarget] < 1)) || (ModuleManager.GetPluginImporterExtension(platform2.targetGroup) == null))
                {
                    continue;
                }
Label_00DD:
                list2.Add(platform2);
            }
            return(list2.ToArray());
        }
Beispiel #12
0
 private void ResetSettingsFromBackend()
 {
     this.m_TargetSettings = null;
     if (base.targets.Length > 0)
     {
         List <BuildPlayerWindow.BuildPlatform> validPlatforms = BuildPlayerWindow.GetValidPlatforms();
         this.m_TargetSettings = new VideoClipImporterInspector.InspectorTargetSettings[base.targets.Length, validPlatforms.Count + 1];
         for (int i = 0; i < base.targets.Length; i++)
         {
             VideoClipImporter videoClipImporter = (VideoClipImporter)base.targets[i];
             this.m_TargetSettings[i, 0] = new VideoClipImporterInspector.InspectorTargetSettings();
             this.m_TargetSettings[i, 0].overridePlatform = true;
             this.m_TargetSettings[i, 0].settings         = videoClipImporter.defaultTargetSettings;
             for (int j = 1; j < validPlatforms.Count + 1; j++)
             {
                 BuildTargetGroup targetGroup = validPlatforms[j - 1].targetGroup;
                 this.m_TargetSettings[i, j]                  = new VideoClipImporterInspector.InspectorTargetSettings();
                 this.m_TargetSettings[i, j].settings         = videoClipImporter.Internal_GetTargetSettings(targetGroup);
                 this.m_TargetSettings[i, j].overridePlatform = (this.m_TargetSettings[i, j].settings != null);
             }
         }
     }
     this.m_ModifiedTargetSettings = false;
 }
 internal static int BeginPlatformGrouping(BuildPlayerWindow.BuildPlatform[] platforms, GUIContent defaultTab)
 {
   int num1 = -1;
   for (int index = 0; index < platforms.Length; ++index)
   {
     if (platforms[index].targetGroup == EditorUserBuildSettings.selectedBuildTargetGroup)
       num1 = index;
   }
   if (num1 == -1)
   {
     EditorGUILayout.s_SelectedDefault.value = true;
     num1 = 0;
   }
   int index1 = defaultTab != null ? (!EditorGUILayout.s_SelectedDefault.value ? num1 : -1) : num1;
   bool enabled = GUI.enabled;
   GUI.enabled = true;
   EditorGUI.BeginChangeCheck();
   Rect rect = EditorGUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[0]);
   --rect.width;
   int length = platforms.Length;
   int num2 = 18;
   GUIStyle toolbarButton = EditorStyles.toolbarButton;
   if (defaultTab != null && GUI.Toggle(new Rect(rect.x, rect.y, rect.width - (float) length * 30f, (float) num2), index1 == -1, defaultTab, toolbarButton))
     index1 = -1;
   for (int index2 = 0; index2 < length; ++index2)
   {
     Rect position;
     if (defaultTab != null)
     {
       position = new Rect(rect.xMax - (float) (length - index2) * 30f, rect.y, 30f, (float) num2);
     }
     else
     {
       int num3 = Mathf.RoundToInt((float) index2 * rect.width / (float) length);
       int num4 = Mathf.RoundToInt((float) (index2 + 1) * rect.width / (float) length);
       position = new Rect(rect.x + (float) num3, rect.y, (float) (num4 - num3), (float) num2);
     }
     if (GUI.Toggle(position, index1 == index2, new GUIContent((Texture) platforms[index2].smallIcon, platforms[index2].tooltip), toolbarButton))
       index1 = index2;
   }
   GUILayoutUtility.GetRect(10f, (float) num2);
   GUI.enabled = enabled;
   if (EditorGUI.EndChangeCheck())
   {
     if (defaultTab == null)
       EditorUserBuildSettings.selectedBuildTargetGroup = platforms[index1].targetGroup;
     else if (index1 < 0)
     {
       EditorGUILayout.s_SelectedDefault.value = true;
     }
     else
     {
       EditorUserBuildSettings.selectedBuildTargetGroup = platforms[index1].targetGroup;
       EditorGUILayout.s_SelectedDefault.value = false;
     }
     foreach (UnityEngine.Object @object in Resources.FindObjectsOfTypeAll(typeof (BuildPlayerWindow)))
     {
       BuildPlayerWindow buildPlayerWindow = @object as BuildPlayerWindow;
       if ((UnityEngine.Object) buildPlayerWindow != (UnityEngine.Object) null)
         buildPlayerWindow.Repaint();
     }
   }
   return index1;
 }
 internal static int BeginPlatformGrouping(BuildPlayerWindow.BuildPlatform[] platforms, GUIContent defaultTab)
 {
     return BeginPlatformGrouping(platforms, defaultTab, GUI.skin.box);
 }
 internal static int BeginPlatformGrouping(BuildPlayerWindow.BuildPlatform[] platforms, GUIContent defaultTab, GUIStyle style)
 {
     int num = -1;
     for (int i = 0; i < platforms.Length; i++)
     {
         if (platforms[i].targetGroup == EditorUserBuildSettings.selectedBuildTargetGroup)
         {
             num = i;
         }
     }
     if (num == -1)
     {
         s_SelectedDefault.value = true;
         num = 0;
     }
     int index = (defaultTab != null) ? (!s_SelectedDefault.value ? num : -1) : num;
     bool enabled = GUI.enabled;
     GUI.enabled = true;
     EditorGUI.BeginChangeCheck();
     Rect rect = BeginVertical(style, new GUILayoutOption[0]);
     rect.width--;
     int length = platforms.Length;
     int num5 = 0x12;
     GUIStyle toolbarButton = EditorStyles.toolbarButton;
     if ((defaultTab != null) && GUI.Toggle(new Rect(rect.x, rect.y, rect.width - (length * 30f), (float) num5), index == -1, defaultTab, toolbarButton))
     {
         index = -1;
     }
     for (int j = 0; j < length; j++)
     {
         Rect rect2;
         if (defaultTab != null)
         {
             rect2 = new Rect(rect.xMax - ((length - j) * 30f), rect.y, 30f, (float) num5);
         }
         else
         {
             int num7 = Mathf.RoundToInt((j * rect.width) / ((float) length));
             int num8 = Mathf.RoundToInt(((j + 1) * rect.width) / ((float) length));
             rect2 = new Rect(rect.x + num7, rect.y, (float) (num8 - num7), (float) num5);
         }
         if (GUI.Toggle(rect2, index == j, new GUIContent(platforms[j].smallIcon, platforms[j].tooltip), toolbarButton))
         {
             index = j;
         }
     }
     GUILayoutUtility.GetRect(10f, (float) num5);
     GUI.enabled = enabled;
     if (EditorGUI.EndChangeCheck())
     {
         if (defaultTab == null)
         {
             EditorUserBuildSettings.selectedBuildTargetGroup = platforms[index].targetGroup;
         }
         else if (index < 0)
         {
             s_SelectedDefault.value = true;
         }
         else
         {
             EditorUserBuildSettings.selectedBuildTargetGroup = platforms[index].targetGroup;
             s_SelectedDefault.value = false;
         }
         Object[] objArray = Resources.FindObjectsOfTypeAll(typeof(BuildPlayerWindow));
         for (int k = 0; k < objArray.Length; k++)
         {
             BuildPlayerWindow window = objArray[k] as BuildPlayerWindow;
             if (window != null)
             {
                 window.Repaint();
             }
         }
     }
     return index;
 }
		private void ShowOption(BuildPlayerWindow.BuildPlatform bp, GUIContent title, GUIStyle background)
		{
			Rect rect = GUILayoutUtility.GetRect(50f, 36f);
			rect.x += 1f;
			rect.y += 1f;
			bool flag = BuildPipeline.LicenseCheck(bp.DefaultTarget);
			GUI.contentColor = new Color(1f, 1f, 1f, (!flag) ? 0.7f : 1f);
			bool flag2 = EditorUserBuildSettings.selectedBuildTargetGroup == bp.targetGroup;
			if (Event.current.type == EventType.Repaint)
			{
				background.Draw(rect, GUIContent.none, false, false, flag2, false);
				GUI.Label(new Rect(rect.x + 3f, rect.y + 3f, 32f, 32f), title.image, GUIStyle.none);
				if (BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget) == bp.targetGroup)
				{
					GUI.Label(new Rect(rect.xMax - (float)BuildPlayerWindow.styles.activePlatformIcon.width - 8f, rect.y + 3f + (float)((32 - BuildPlayerWindow.styles.activePlatformIcon.height) / 2), (float)BuildPlayerWindow.styles.activePlatformIcon.width, (float)BuildPlayerWindow.styles.activePlatformIcon.height), BuildPlayerWindow.styles.activePlatformIcon, GUIStyle.none);
				}
			}
			if (GUI.Toggle(rect, flag2, title.text, BuildPlayerWindow.styles.platformSelector) && EditorUserBuildSettings.selectedBuildTargetGroup != bp.targetGroup)
			{
				EditorUserBuildSettings.selectedBuildTargetGroup = bp.targetGroup;
				UnityEngine.Object[] array = Resources.FindObjectsOfTypeAll(typeof(InspectorWindow));
				for (int i = 0; i < array.Length; i++)
				{
					InspectorWindow inspectorWindow = array[i] as InspectorWindow;
					if (inspectorWindow != null)
					{
						inspectorWindow.Repaint();
					}
				}
			}
		}
		private static BuildTarget RestoreLastKnownPlatformsBuildTarget(BuildPlayerWindow.BuildPlatform bp)
		{
			BuildTargetGroup targetGroup = bp.targetGroup;
			if (targetGroup == BuildTargetGroup.Standalone)
			{
				return EditorUserBuildSettings.selectedStandaloneTarget;
			}
			if (targetGroup != BuildTargetGroup.WebPlayer)
			{
				return bp.DefaultTarget;
			}
			return (!EditorUserBuildSettings.webPlayerStreamed) ? BuildTarget.WebPlayer : BuildTarget.WebPlayerStreamed;
		}
		internal static int BeginPlatformGrouping(BuildPlayerWindow.BuildPlatform[] platforms, GUIContent defaultTab)
		{
			int num = -1;
			for (int i = 0; i < platforms.Length; i++)
			{
				if (platforms[i].targetGroup == EditorUserBuildSettings.selectedBuildTargetGroup)
				{
					num = i;
				}
			}
			if (num == -1)
			{
				EditorGUILayout.s_SelectedDefault.value = true;
				num = 0;
			}
			int num2 = (defaultTab != null) ? ((!EditorGUILayout.s_SelectedDefault.value) ? num : -1) : num;
			bool enabled = GUI.enabled;
			GUI.enabled = true;
			EditorGUI.BeginChangeCheck();
			Rect rect = EditorGUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[0]);
			rect.width -= 1f;
			int num3 = platforms.Length;
			int num4 = 18;
			GUIStyle toolbarButton = EditorStyles.toolbarButton;
			if (defaultTab != null && GUI.Toggle(new Rect(rect.x, rect.y, rect.width - (float)num3 * 30f, (float)num4), num2 == -1, defaultTab, toolbarButton))
			{
				num2 = -1;
			}
			for (int j = 0; j < num3; j++)
			{
				Rect position;
				if (defaultTab != null)
				{
					position = new Rect(rect.xMax - (float)(num3 - j) * 30f, rect.y, 30f, (float)num4);
				}
				else
				{
					int num5 = Mathf.RoundToInt((float)j * rect.width / (float)num3);
					int num6 = Mathf.RoundToInt((float)(j + 1) * rect.width / (float)num3);
					position = new Rect(rect.x + (float)num5, rect.y, (float)(num6 - num5), (float)num4);
				}
				if (GUI.Toggle(position, num2 == j, new GUIContent(platforms[j].smallIcon, platforms[j].tooltip), toolbarButton))
				{
					num2 = j;
				}
			}
			GUILayoutUtility.GetRect(10f, (float)num4);
			GUI.enabled = enabled;
			if (EditorGUI.EndChangeCheck())
			{
				if (defaultTab == null)
				{
					EditorUserBuildSettings.selectedBuildTargetGroup = platforms[num2].targetGroup;
				}
				else
				{
					if (num2 < 0)
					{
						EditorGUILayout.s_SelectedDefault.value = true;
					}
					else
					{
						EditorUserBuildSettings.selectedBuildTargetGroup = platforms[num2].targetGroup;
						EditorGUILayout.s_SelectedDefault.value = false;
					}
				}
				UnityEngine.Object[] array = Resources.FindObjectsOfTypeAll(typeof(BuildPlayerWindow));
				for (int k = 0; k < array.Length; k++)
				{
					BuildPlayerWindow buildPlayerWindow = array[k] as BuildPlayerWindow;
					if (buildPlayerWindow != null)
					{
						buildPlayerWindow.Repaint();
					}
				}
			}
			return num2;
		}
 private static void GUIBuildButtons(IBuildWindowExtension buildWindowExtension, bool enableBuildButton, bool enableBuildAndRunButton, bool canInstallInBuildFolder, BuildPlayerWindow.BuildPlatform platform)
 {
   GUILayout.FlexibleSpace();
   if (canInstallInBuildFolder)
     EditorUserBuildSettings.installInBuildFolder = GUILayout.Toggle((EditorUserBuildSettings.installInBuildFolder ? 1 : 0) != 0, "Install in Builds folder\n(for debugging with source code)", new GUILayoutOption[1]
     {
       GUILayout.ExpandWidth(false)
     });
   else
     EditorUserBuildSettings.installInBuildFolder = false;
   if (buildWindowExtension != null && Unsupported.IsDeveloperBuild())
     buildWindowExtension.ShowInternalPlatformBuildOptions();
   GUILayout.BeginHorizontal();
   GUILayout.FlexibleSpace();
   if (EditorGUILayout.LinkLabel(BuildPlayerWindow.styles.learnAboutUnityCloudBuild))
     Application.OpenURL(string.Format("{0}/from/editor/buildsettings?upid={1}&pid={2}&currentplatform={3}&selectedplatform={4}&unityversion={5}", (object) WebURLs.cloudBuildPage, (object) PlayerSettings.cloudProjectId, (object) PlayerSettings.productGUID, (object) EditorUserBuildSettings.activeBuildTarget, (object) BuildPlayerWindow.CalculateSelectedBuildTarget(), (object) Application.unityVersion));
   GUILayout.EndHorizontal();
   GUILayout.Space(6f);
   GUILayout.BeginHorizontal();
   GUILayout.FlexibleSpace();
   GUIContent content = BuildPlayerWindow.styles.build;
   if (platform.targetGroup == BuildTargetGroup.Android && EditorUserBuildSettings.exportAsGoogleAndroidProject)
     content = BuildPlayerWindow.styles.export;
   if (platform.targetGroup == BuildTargetGroup.iPhone && Application.platform != RuntimePlatform.OSXEditor)
     enableBuildAndRunButton = false;
   GUI.enabled = enableBuildButton;
   if (GUILayout.Button(content, new GUILayoutOption[1]
   {
     GUILayout.Width(110f)
   }))
   {
     BuildPlayerWindow.BuildPlayerWithDefaultSettings(true, BuildOptions.ShowBuiltPlayer);
     GUIUtility.ExitGUI();
   }
   GUI.enabled = enableBuildAndRunButton;
   if (GUILayout.Button(BuildPlayerWindow.styles.buildAndRun, new GUILayoutOption[1]
   {
     GUILayout.Width(110f)
   }))
   {
     BuildPlayerWindow.BuildPlayerWithDefaultSettings(true, BuildOptions.AutoRunPlayer);
     GUIUtility.ExitGUI();
   }
   GUILayout.EndHorizontal();
 }
 private static void GUIBuildButtons(bool enableBuildButton, bool enableBuildAndRunButton, bool canInstallInBuildFolder, BuildPlayerWindow.BuildPlatform platform)
 {
   BuildPlayerWindow.GUIBuildButtons((IBuildWindowExtension) null, enableBuildButton, enableBuildAndRunButton, canInstallInBuildFolder, platform);
 }
 private static BuildTarget RestoreLastKnownPlatformsBuildTarget(BuildPlayerWindow.BuildPlatform bp)
 {
   switch (bp.targetGroup)
   {
     case BuildTargetGroup.Standalone:
       return EditorUserBuildSettings.selectedStandaloneTarget;
     case BuildTargetGroup.WebPlayer:
       return EditorUserBuildSettings.webPlayerStreamed ? BuildTarget.WebPlayerStreamed : BuildTarget.WebPlayer;
     default:
       return bp.DefaultTarget;
   }
 }
 private bool SyncSettingsToBackend()
 {
     BuildPlayerWindow.BuildPlatform[] array = BuildPlayerWindow.GetValidPlatforms().ToArray();
     foreach (AudioImporter audioImporterTarget in this.GetAllAudioImporterTargets())
     {
         AudioImporterSampleSettings defaultSampleSettings = audioImporterTarget.defaultSampleSettings;
         if (this.m_DefaultSampleSettings.loadTypeChanged)
         {
             defaultSampleSettings.loadType = this.m_DefaultSampleSettings.settings.loadType;
         }
         if (this.m_DefaultSampleSettings.sampleRateSettingChanged)
         {
             defaultSampleSettings.sampleRateSetting = this.m_DefaultSampleSettings.settings.sampleRateSetting;
         }
         if (this.m_DefaultSampleSettings.sampleRateOverrideChanged)
         {
             defaultSampleSettings.sampleRateOverride = this.m_DefaultSampleSettings.settings.sampleRateOverride;
         }
         if (this.m_DefaultSampleSettings.compressionFormatChanged)
         {
             defaultSampleSettings.compressionFormat = this.m_DefaultSampleSettings.settings.compressionFormat;
         }
         if (this.m_DefaultSampleSettings.qualityChanged)
         {
             defaultSampleSettings.quality = this.m_DefaultSampleSettings.settings.quality;
         }
         if (this.m_DefaultSampleSettings.conversionModeChanged)
         {
             defaultSampleSettings.conversionMode = this.m_DefaultSampleSettings.settings.conversionMode;
         }
         audioImporterTarget.defaultSampleSettings = defaultSampleSettings;
         foreach (BuildPlayerWindow.BuildPlatform buildPlatform in array)
         {
             BuildTargetGroup targetGroup = buildPlatform.targetGroup;
             if (this.m_SampleSettingOverrides.ContainsKey(targetGroup))
             {
                 AudioImporterInspector.SampleSettingProperties sampleSettingOverride = this.m_SampleSettingOverrides[targetGroup];
                 if (sampleSettingOverride.overrideIsForced && !sampleSettingOverride.forcedOverrideState)
                 {
                     audioImporterTarget.Internal_ClearSampleSettingOverride(targetGroup);
                 }
                 else if (audioImporterTarget.Internal_ContainsSampleSettingsOverride(targetGroup) || sampleSettingOverride.overrideIsForced && sampleSettingOverride.forcedOverrideState)
                 {
                     AudioImporterSampleSettings overrideSampleSettings = audioImporterTarget.Internal_GetOverrideSampleSettings(targetGroup);
                     if (sampleSettingOverride.loadTypeChanged)
                     {
                         overrideSampleSettings.loadType = sampleSettingOverride.settings.loadType;
                     }
                     if (sampleSettingOverride.sampleRateSettingChanged)
                     {
                         overrideSampleSettings.sampleRateSetting = sampleSettingOverride.settings.sampleRateSetting;
                     }
                     if (sampleSettingOverride.sampleRateOverrideChanged)
                     {
                         overrideSampleSettings.sampleRateOverride = sampleSettingOverride.settings.sampleRateOverride;
                     }
                     if (sampleSettingOverride.compressionFormatChanged)
                     {
                         overrideSampleSettings.compressionFormat = sampleSettingOverride.settings.compressionFormat;
                     }
                     if (sampleSettingOverride.qualityChanged)
                     {
                         overrideSampleSettings.quality = sampleSettingOverride.settings.quality;
                     }
                     if (sampleSettingOverride.conversionModeChanged)
                     {
                         overrideSampleSettings.conversionMode = sampleSettingOverride.settings.conversionMode;
                     }
                     audioImporterTarget.Internal_SetOverrideSampleSettings(targetGroup, overrideSampleSettings);
                 }
                 this.m_SampleSettingOverrides[targetGroup] = sampleSettingOverride;
             }
         }
     }
     this.m_DefaultSampleSettings.ClearChangedFlags();
     foreach (BuildPlayerWindow.BuildPlatform buildPlatform in array)
     {
         BuildTargetGroup targetGroup = buildPlatform.targetGroup;
         if (this.m_SampleSettingOverrides.ContainsKey(targetGroup))
         {
             AudioImporterInspector.SampleSettingProperties sampleSettingOverride = this.m_SampleSettingOverrides[targetGroup];
             sampleSettingOverride.ClearChangedFlags();
             this.m_SampleSettingOverrides[targetGroup] = sampleSettingOverride;
         }
     }
     return(true);
 }
		private static void GUIBuildButtons(bool enableBuildButton, bool enableBuildAndRunButton, bool canInstallInBuildFolder, BuildPlayerWindow.BuildPlatform platform)
		{
			GUILayout.FlexibleSpace();
			if (canInstallInBuildFolder)
			{
				EditorUserBuildSettings.installInBuildFolder = GUILayout.Toggle(EditorUserBuildSettings.installInBuildFolder, "Install in Builds folder\n(for debugging with source code)", new GUILayoutOption[]
				{
					GUILayout.ExpandWidth(false)
				});
			}
			else
			{
				EditorUserBuildSettings.installInBuildFolder = false;
			}
			GUILayout.BeginHorizontal(new GUILayoutOption[0]);
			GUILayout.FlexibleSpace();
			GUIContent content = BuildPlayerWindow.styles.build;
			if (platform.targetGroup == BuildTargetGroup.Android && EditorUserBuildSettings.exportAsGoogleAndroidProject)
			{
				content = BuildPlayerWindow.styles.export;
			}
			if (platform.targetGroup == BuildTargetGroup.iOS && Application.platform != RuntimePlatform.OSXEditor)
			{
				enableBuildAndRunButton = false;
			}
			GUI.enabled = enableBuildButton;
			if (GUILayout.Button(content, new GUILayoutOption[]
			{
				GUILayout.Width(110f)
			}))
			{
				BuildPlayerWindow.BuildPlayerWithDefaultSettings(true, BuildOptions.ShowBuiltPlayer);
				GUIUtility.ExitGUI();
			}
			GUI.enabled = enableBuildAndRunButton;
			if (GUILayout.Button(BuildPlayerWindow.styles.buildAndRun, new GUILayoutOption[]
			{
				GUILayout.Width(110f)
			}))
			{
				BuildPlayerWindow.BuildPlayerWithDefaultSettings(true, BuildOptions.AutoRunPlayer);
				GUIUtility.ExitGUI();
			}
			GUILayout.EndHorizontal();
		}
 private void ShowOption(BuildPlayerWindow.BuildPlatform bp, GUIContent title, GUIStyle background)
 {
   Rect rect = GUILayoutUtility.GetRect(50f, 36f);
   ++rect.x;
   ++rect.y;
   GUI.contentColor = new Color(1f, 1f, 1f, !BuildPipeline.LicenseCheck(bp.DefaultTarget) ? 0.7f : 1f);
   bool on = EditorUserBuildSettings.selectedBuildTargetGroup == bp.targetGroup;
   if (Event.current.type == EventType.Repaint)
   {
     background.Draw(rect, GUIContent.none, false, false, on, false);
     GUI.Label(new Rect(rect.x + 3f, rect.y + 3f, 32f, 32f), title.image, GUIStyle.none);
     if (BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget) == bp.targetGroup)
       GUI.Label(new Rect((float) ((double) rect.xMax - (double) BuildPlayerWindow.styles.activePlatformIcon.width - 8.0), rect.y + 3f + (float) ((32 - BuildPlayerWindow.styles.activePlatformIcon.height) / 2), (float) BuildPlayerWindow.styles.activePlatformIcon.width, (float) BuildPlayerWindow.styles.activePlatformIcon.height), (Texture) BuildPlayerWindow.styles.activePlatformIcon, GUIStyle.none);
   }
   if (!GUI.Toggle(rect, on, title.text, BuildPlayerWindow.styles.platformSelector) || EditorUserBuildSettings.selectedBuildTargetGroup == bp.targetGroup)
     return;
   EditorUserBuildSettings.selectedBuildTargetGroup = bp.targetGroup;
   foreach (UnityEngine.Object @object in Resources.FindObjectsOfTypeAll(typeof (InspectorWindow)))
   {
     InspectorWindow inspectorWindow = @object as InspectorWindow;
     if ((UnityEngine.Object) inspectorWindow != (UnityEngine.Object) null)
       inspectorWindow.Repaint();
   }
 }
 private bool ResetSettingsFromBackend()
 {
     if (this.GetAllAudioImporterTargets().Any <AudioImporter>())
     {
         AudioImporter audioImporter = this.GetAllAudioImporterTargets().First <AudioImporter>();
         this.m_DefaultSampleSettings.settings = audioImporter.defaultSampleSettings;
         this.m_DefaultSampleSettings.ClearChangedFlags();
         this.m_SampleSettingOverrides = new Dictionary <BuildTargetGroup, AudioImporterInspector.SampleSettingProperties>();
         using (List <BuildPlayerWindow.BuildPlatform> .Enumerator enumerator = BuildPlayerWindow.GetValidPlatforms().GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 BuildTargetGroup targetGroup = enumerator.Current.targetGroup;
                 foreach (AudioImporter audioImporterTarget in this.GetAllAudioImporterTargets())
                 {
                     if (audioImporterTarget.Internal_ContainsSampleSettingsOverride(targetGroup))
                     {
                         this.m_SampleSettingOverrides[targetGroup] = new AudioImporterInspector.SampleSettingProperties()
                         {
                             settings = audioImporterTarget.Internal_GetOverrideSampleSettings(targetGroup)
                         };
                         break;
                     }
                 }
                 if (!this.m_SampleSettingOverrides.ContainsKey(targetGroup))
                 {
                     this.m_SampleSettingOverrides[targetGroup] = new AudioImporterInspector.SampleSettingProperties()
                     {
                         settings = audioImporter.Internal_GetOverrideSampleSettings(targetGroup)
                     }
                 }
                 ;
             }
         }
     }
     return(true);
 }