private void HandlePlatformSettingUI() { int shownTextureFormatPage = EditorGUILayout.BeginPlatformGrouping(m_ValidPlatforms.ToArray(), s_Styles.defaultPlatformLabel); if (shownTextureFormatPage == -1) { List <TextureImporterPlatformSettings> platformSettings = m_TempPlatformSettings[kDefaultPlatformName]; List <TextureImporterPlatformSettings> newSettings = new List <TextureImporterPlatformSettings>(platformSettings.Count); for (var i = 0; i < platformSettings.Count; ++i) { TextureImporterPlatformSettings settings = new TextureImporterPlatformSettings(); platformSettings[i].CopyTo(settings); newSettings.Add(settings); } if (m_TexturePlatformSettingsController.HandleDefaultSettings(newSettings, m_TexturePlatformSettingsView)) { for (var i = 0; i < newSettings.Count; ++i) { if (platformSettings[i].maxTextureSize != newSettings[i].maxTextureSize) { m_MaxTextureSize.intValue = newSettings[i].maxTextureSize; } if (platformSettings[i].textureCompression != newSettings[i].textureCompression) { m_TextureCompression.enumValueIndex = (int)newSettings[i].textureCompression; } if (platformSettings[i].crunchedCompression != newSettings[i].crunchedCompression) { m_UseCrunchedCompression.boolValue = newSettings[i].crunchedCompression; } if (platformSettings[i].compressionQuality != newSettings[i].compressionQuality) { m_CompressionQuality.intValue = newSettings[i].compressionQuality; } newSettings[i].CopyTo(platformSettings[i]); } } } else { BuildPlatform buildPlatform = m_ValidPlatforms[shownTextureFormatPage]; List <TextureImporterPlatformSettings> platformSettings = m_TempPlatformSettings[buildPlatform.name]; // Predetermine format if overridden is unchecked for (var i = 0; i < platformSettings.Count; ++i) { var settings = platformSettings[i]; if (!settings.overridden) { SpriteAtlas sa = (SpriteAtlas)targets[i]; settings.format = sa.FormatDetermineByAtlasSettings(buildPlatform.defaultTarget); } } m_TexturePlatformSettingsView.buildPlatformTitle = buildPlatform.title.text; if (m_TexturePlatformSettingsController.HandlePlatformSettings(buildPlatform.defaultTarget, platformSettings, m_TexturePlatformSettingsView, m_TexturePlatformSettingTextureHelper)) { for (var i = 0; i < platformSettings.Count; ++i) { SpriteAtlas sa = (SpriteAtlas)targets[i]; sa.SetPlatformSettings(platformSettings[i]); } } } EditorGUILayout.EndPlatformGrouping(); }
private void HandlePlatformSettingUI() { int num = EditorGUILayout.BeginPlatformGrouping(this.m_ValidPlatforms.ToArray(), SpriteAtlasInspector.s_Styles.defaultPlatformLabel); if (num == -1) { List <TextureImporterPlatformSettings> list = this.m_TempPlatformSettings[this.kDefaultPlatformName]; List <TextureImporterPlatformSettings> list2 = new List <TextureImporterPlatformSettings>(list.Count); for (int i = 0; i < list.Count; i++) { TextureImporterPlatformSettings textureImporterPlatformSettings = new TextureImporterPlatformSettings(); list[i].CopyTo(textureImporterPlatformSettings); list2.Add(textureImporterPlatformSettings); } if (this.m_TexturePlatformSettingsController.HandleDefaultSettings(list2, this.m_TexturePlatformSettingsView)) { for (int j = 0; j < list2.Count; j++) { if (list[j].maxTextureSize != list2[j].maxTextureSize) { this.m_MaxTextureSize.intValue = list2[j].maxTextureSize; } if (list[j].textureCompression != list2[j].textureCompression) { this.m_TextureCompression.enumValueIndex = (int)list2[j].textureCompression; } if (list[j].crunchedCompression != list2[j].crunchedCompression) { this.m_UseCrunchedCompression.boolValue = list2[j].crunchedCompression; } if (list[j].compressionQuality != list2[j].compressionQuality) { this.m_CompressionQuality.intValue = list2[j].compressionQuality; } list2[j].CopyTo(list[j]); } } } else { BuildPlatform buildPlatform = this.m_ValidPlatforms[num]; List <TextureImporterPlatformSettings> list3 = this.m_TempPlatformSettings[buildPlatform.name]; for (int k = 0; k < list3.Count; k++) { TextureImporterPlatformSettings textureImporterPlatformSettings2 = list3[k]; if (!textureImporterPlatformSettings2.overridden) { SpriteAtlas spriteAtlas = (SpriteAtlas)base.targets[k]; textureImporterPlatformSettings2.format = spriteAtlas.FormatDetermineByAtlasSettings(buildPlatform.defaultTarget); } } this.m_TexturePlatformSettingsView.buildPlatformTitle = buildPlatform.title.text; if (this.m_TexturePlatformSettingsController.HandlePlatformSettings(buildPlatform.defaultTarget, list3, this.m_TexturePlatformSettingsView, this.m_TexturePlatformSettingTextureHelper)) { for (int l = 0; l < list3.Count; l++) { SpriteAtlas spriteAtlas2 = (SpriteAtlas)base.targets[l]; spriteAtlas2.SetPlatformSettings(list3[l]); } } } EditorGUILayout.EndPlatformGrouping(); }