Namespace: | Sirenix.OdinInspector |
Assembly: | Sirenix.OdinInspector.Attributes |
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = true, Inherited = true)]
[Conditional("UNITY_EDITOR")]
[DontApplyToListElements]
public sealed class ListDrawerSettingsAttribute : Attribute, _Attribute
This attribute is scheduled for refactoring.
This example shows how you can add your own custom add button to a list.
[ListDrawerSettings(HideAddButton = true, OnTitleBarGUI = "DrawTitleBarGUI")]
public List<MyType> SomeList;
#if UNITY_EDITOR
private void DrawTitleBarGUI()
{
if (SirenixEditorGUI.ToolbarButton(EditorIcons.Plus))
{
this.SomeList.Add(new MyType());
}
}
#endif
public ListDrawerSettingsAttribute()
public bool AddCopiesLastElement
public bool AlwaysAddDefaultValue
public string CustomAddFunction
public string CustomRemoveElementFunction
public string CustomRemoveIndexFunction
public string ElementColor
public bool HideAddButton
public bool HideRemoveButton
public string ListElementLabelName
public string OnBeginListElementGUI
public string OnEndListElementGUI
public bool ShowFoldout
public bool DefaultExpandedState { get; set; }
public bool DefaultExpandedStateHasValue { get; }
public bool DraggableHasValue { get; }
public bool DraggableItems { get; set; }
public bool IsReadOnly { get; set; }
public bool IsReadOnlyHasValue { get; }
public int NumberOfItemsPerPage { get; set; }
public bool NumberOfItemsPerPageHasValue { get; }
public string OnTitleBarGUI { get; set; }
public bool PagingHasValue { get; }
public bool ShowIndexLabels { get; set; }
public bool ShowIndexLabelsHasValue { get; }
public bool ShowItemCount { get; set; }
public bool ShowItemCountHasValue { get; }
public bool ShowPaging { get; set; }