Пример #1
0
 internal override void OnHeaderControlsGUI()
 {
     using (new EditorGUI.DisabledScope(targets.Length != 1 || Preset.IsPresetExcludedFromDefaultPresets(target as Preset)))
     {
         var preset = (Preset)target;
         if (Preset.GetDefaultForPreset(preset) == preset)
         {
             if (GUILayout.Button(string.Format("Remove from {0} Default", preset.GetTargetTypeName()), EditorStyles.miniButton, GUILayout.ExpandWidth(false)))
             {
                 Preset.RemoveFromDefault(preset);
             }
         }
         else
         {
             if (GUILayout.Button(string.Format("Set as {0} Default", preset.GetTargetTypeName()), EditorStyles.miniButton, GUILayout.ExpandWidth(false)))
             {
                 Preset.SetAsDefault(preset);
             }
         }
     }
 }