Namespace: | Sirenix.OdinInspector |
Assembly: | Sirenix.OdinInspector.Attributes |
[Conditional("UNITY_EDITOR")]
[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)]
public class TabGroupAttribute : PropertyGroupAttribute, _Attribute, ISubGroupProviderAttribute
TabGroup is used on any property, and organizes properties into different tabs.
Use this to organize different value to make a clean and easy to use inspector.
Use groups to create multiple tab groups, each with multiple tabs and even sub tabs.
The following example shows how to create a tab group with two tabs.
public class MyComponent : MonoBehaviour
{
[TabGroup("First")]
public int MyFirstInt;
[TabGroup("First")]
public int AnotherInt;
[TabGroup("Second")]
public int MySecondInt;
}
The following example shows how multiple groups of tabs can be created.
public class MyComponent : MonoBehaviour
{
[TabGroup("A", "FirstGroup")]
public int FirstGroupA;
[TabGroup("B", "FirstGroup")]
public int FirstGroupB;
// The second tab group has been configured to have constant height across all tabs.
[TabGroup("A", "SecondGroup", true)]
public int SecondgroupA;
[TabGroup("B", "SecondGroup")]
public int SecondGroupB;
[TabGroup("B", "SecondGroup")]
public int AnotherInt;
}
This example demonstrates how multiple tabs groups can be combined to create tabs in tabs.
public class MyComponent : MonoBehaviour
{
[TabGroup("ParentGroup", "First Tab")]
public int A;
[TabGroup("ParentGroup", "Second Tab")]
public int B;
// Specify 'First Tab' as a group, and another child group to the 'First Tab' group.
[TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab A")]
public int C;
[TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab B")]
public int D;
[TabGroup("ParentGroup/Second Tab/InnerGroup", "Inside Second Tab")]
public int E;
}
public TabGroupAttribute(string tab, bool useFixedHeight = false, float order = 0F)
System.String | tab | The tab. |
System.Boolean | useFixedHeight | if set to |
System.Single | order | The order. |
public TabGroupAttribute(string group, string tab, SdfIconType icon, bool useFixedHeight = false, float order = 0F)
System.String | group | The group to attach the tab to. |
System.String | tab | The name of the tab. |
SdfIconType | icon | |
System.Boolean | useFixedHeight | Set to true to have a constant height across the entire tab group. |
System.Single | order | The order of the group. |
public TabGroupAttribute(string group, string tab, bool useFixedHeight = false, float order = 0F)
System.String | group | The group to attach the tab to. |
System.String | tab | The name of the tab. |
System.Boolean | useFixedHeight | Set to true to have a constant height across the entire tab group. |
System.Single | order | The order of the group. |
public const string DEFAULT_NAME = "_DefaultTabGroup"
public bool HideTabGroupIfTabGroupOnlyHasOneTab
public SdfIconType Icon
public bool Paddingless
public string TabId
public TabLayouting TabLayouting
public string TabName
public List<TabGroupAttribute> Tabs
public string TextColor
public bool UseFixedHeight
protected override void CombineValuesWith(PropertyGroupAttribute other)
PropertyGroupAttribute | other |