UnityEditor.PresetLibrary.Draw C# (CSharp) Method

Draw() public abstract method

public abstract Draw ( Rect rect, int index ) : void
rect UnityEngine.Rect
index int
return void
        public abstract void Draw(Rect rect, int index);
        public abstract void Draw(Rect rect, object presetObject);

Same methods

PresetLibrary::Draw ( Rect rect, object presetObject ) : void

Usage Example

示例#1
0
 private void CreateNewPresetButton(Rect buttonRect, object newPresetObject, PresetLibrary lib, bool isOpenForEdit)
 {
     EditorGUI.BeginDisabledGroup(!isOpenForEdit);
     if (GUI.Button(buttonRect, !isOpenForEdit ? PresetLibraryEditor <T> .s_Styles.plusButtonTextNotCheckedOut : PresetLibraryEditor <T> .s_Styles.plusButtonText))
     {
         int itemIndex = this.CreateNewPreset(newPresetObject, string.Empty);
         if (this.drawLabels)
         {
             this.BeginRenaming(string.Empty, itemIndex, 0f);
         }
         InspectorWindow.RepaintAllInspectors();
     }
     if (Event.current.type == EventType.Repaint)
     {
         Rect rect = new RectOffset(-3, -3, -3, -3).Add(buttonRect);
         lib.Draw(rect, newPresetObject);
         if (buttonRect.width > 30f)
         {
             PresetLibraryEditor <T> .LabelWithOutline(buttonRect, PresetLibraryEditor <T> .s_Styles.newPreset, new Color(0.1f, 0.1f, 0.1f), PresetLibraryEditor <T> .s_Styles.newPresetStyle);
         }
         else if ((lib.Count() == 0) && isOpenForEdit)
         {
             buttonRect.x      = buttonRect.xMax + 5f;
             buttonRect.width  = 200f;
             buttonRect.height = 16f;
             EditorGUI.BeginDisabledGroup(true);
             GUI.Label(buttonRect, "Click to add new preset");
             EditorGUI.EndDisabledGroup();
         }
     }
     EditorGUI.EndDisabledGroup();
 }
All Usage Examples Of UnityEditor.PresetLibrary::Draw