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")]
public class FoldoutGroupAttribute : PropertyGroupAttribute, _Attribute
FoldoutGroup is used on any property, and organizes properties into a foldout.
Use this to organize properties, and to allow the user to hide properties that are not relevant for them at the moment.
The following example shows how FoldoutGroup is used to organize properties into a foldout.
public class MyComponent : MonoBehaviour
{
[FoldoutGroup("MyGroup")]
public int A;
[FoldoutGroup("MyGroup")]
public int B;
[FoldoutGroup("MyGroup")]
public int C;
}
The following example shows how properties can be organizes into multiple foldouts.
public class MyComponent : MonoBehaviour
{
[FoldoutGroup("First")]
public int A;
[FoldoutGroup("First")]
public int B;
[FoldoutGroup("Second")]
public int C;
}
public FoldoutGroupAttribute(string groupName, bool expanded, float order = 0F)
System.String | groupName | Name of the foldout group. |
System.Boolean | expanded | Whether or not the foldout should be expanded by default. |
System.Single | order | The order of the group in the inspector. |
public FoldoutGroupAttribute(string groupName, float order = 0F)
System.String | groupName | Name of the foldout group. |
System.Single | order | The order of the group in the inspector. |
public bool Expanded { get; set; }
public bool HasDefinedExpanded { get; }
protected override void CombineValuesWith(PropertyGroupAttribute other)
PropertyGroupAttribute | other | The group to combine with. |