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)448, AllowMultiple = True, Inherited = True)]
public class TabGroupAttribute : PropertyGroupAttribute, Sirenix.OdinInspector.Internal.ISubGroupProviderAttribute
}

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 1.0.4.1

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.

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
string TabName Name of the tab.
List Tabs Name of all tabs in this group.
bool UseFixedHeight Should this tab be the same height as the rest of the tab 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;
}