Version 2.1.0.0

Odin has a dedicated attribute overview with examples

TabGroupAttribute class

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)]
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.

Inheritance
Remarks

Use groups to create multiple tab groups, each with multiple tabs and even sub tabs.

Example

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;
}
Example

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;
}
Example

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;
}

Constructors

TabGroupAttribute(String, Boolean, Int32)
Organizes the property into the specified tab in the default group. Default group name is '_DefaultTabGroup'
public TabGroupAttribute(string tab, bool useFixedHeight = false, int order = 0)
Parameters
System.String tab

The tab.

System.Boolean useFixedHeight

if set to true [use fixed height].

System.Int32 order

The order.

TabGroupAttribute(String, String, Boolean, Int32)
Organizes the property into the specified tab in the specified group.
public TabGroupAttribute(string group, string tab, bool useFixedHeight = false, int order = 0)
Parameters
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.Int32 order

The order of the group.

Fields

DEFAULT_NAME
The default tab group name which is used when the single-parameter constructor is called.
public const string DEFAULT_NAME = "_DefaultTabGroup"
Paddingless
If true, the content of each page will not be contained in any box.
public bool Paddingless
TabName
Name of the tab.
public string TabName
UseFixedHeight
Should this tab be the same height as the rest of the tab group.
public bool UseFixedHeight

Properties

Tabs
Name of all tabs in this group.
public List<string> Tabs { get; }

Methods

CombineValuesWith(PropertyGroupAttribute)
Combines the tab group with another group.
protected override void CombineValuesWith(PropertyGroupAttribute other)
Parameters
PropertyGroupAttribute other

The other group.

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.