TabGroupAttribute

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.

namespace Sirenix.OdinInspector
{
[AttributeUsageAttribute((AttributeTargets)32767, AllowMultiple = True, Inherited = True)]
public class TabGroupAttribute : PropertyGroupAttribute, Sirenix.OdinInspector.Internal.ISubGroupProviderAttribute
}

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 2.0.0.0

See Also

  • !:TabListAttribute

Static Fields

Return Type Definition Description
string DEFAULT_NAME The default tab group name which is used when the single-parameter constructor is called.

Fields

Return Type Definition Description
bool Paddingless If true, the content of each page will not be contained in any box.
string TabName Name of the tab.
bool UseFixedHeight Should this tab be the same height as the rest of the tab group.

Constructors

Definition Description
TabGroupAttribute(string, bool, int) Organizes the property into the specified tab in the default group. Default group name is '_DefaultTabGroup'
TabGroupAttribute(string, string, bool, int) Organizes the property into the specified tab in the specified group.

Properties

Return Type Definition Description
List<string> Tabs Name of all tabs in this group.

Methods

Return Type Definition Description
void CombineValuesWith(PropertyGroupAttribute) Combines the tab group with another group.

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