Пример #1
0
 private void HandleCommonSettingUI()
 {
     SpriteAtlasInspector.AtlasType atlasType = SpriteAtlasInspector.AtlasType.Undefined;
     if (this.AllTargetsAreMaster())
     {
         atlasType = SpriteAtlasInspector.AtlasType.Master;
     }
     else if (this.AllTargetsAreVariant())
     {
         atlasType = SpriteAtlasInspector.AtlasType.Variant;
     }
     EditorGUI.BeginChangeCheck();
     EditorGUI.showMixedValue = (atlasType == SpriteAtlasInspector.AtlasType.Undefined);
     atlasType = (SpriteAtlasInspector.AtlasType)EditorGUILayout.IntPopup(SpriteAtlasInspector.s_Styles.atlasTypeLabel, (int)atlasType, SpriteAtlasInspector.s_Styles.atlasTypeOptions, SpriteAtlasInspector.s_Styles.atlasTypeValues, new GUILayoutOption[0]);
     EditorGUI.showMixedValue = false;
     if (EditorGUI.EndChangeCheck())
     {
         bool value = atlasType == SpriteAtlasInspector.AtlasType.Variant;
         UnityEngine.Object[] targets = base.targets;
         for (int i = 0; i < targets.Length; i++)
         {
             SpriteAtlas spriteAtlas = (SpriteAtlas)targets[i];
             spriteAtlas.SetIsVariant(value);
         }
         this.m_TexturePlatformSettingsView = new SpriteAtlasInspector.SpriteAtlasInspectorPlatformSettingView(this.AllTargetsAreMaster());
     }
     if (atlasType == SpriteAtlasInspector.AtlasType.Variant)
     {
         EditorGUI.BeginChangeCheck();
         EditorGUILayout.PropertyField(this.m_MasterAtlas, SpriteAtlasInspector.s_Styles.masterAtlasLabel, new GUILayoutOption[0]);
         if (EditorGUI.EndChangeCheck())
         {
             base.serializedObject.ApplyModifiedProperties();
             UnityEngine.Object[] targets2 = base.targets;
             for (int j = 0; j < targets2.Length; j++)
             {
                 SpriteAtlas spriteAtlas2 = (SpriteAtlas)targets2[j];
                 spriteAtlas2.CopyMasterAtlasSettings();
                 this.SyncPlatformSettings();
             }
         }
     }
     EditorGUILayout.PropertyField(this.m_BindAsDefault, SpriteAtlasInspector.s_Styles.bindAsDefaultLabel, new GUILayoutOption[0]);
 }