Version 3.3.1.2

GUITabGroup class

Namespace: Sirenix.Utilities.Editor
Assembly: Sirenix.Utilities.Editor
public class GUITabGroup
The GUITabGroup is a utility class to draw animated tab groups.
Inheritance
  • System.Object
  • GUITabGroup
Example
var tabGroup = SirenixEditorGUI.CreateAnimatedTabGroup(someKey);
// Register your tabs before starting BeginGroup.
var tab1 = tabGroup.RegisterTab("tab 1");
var tab2 = tabGroup.RegisterTab("tab 2");

tabGroup.BeginGroup(drawToolbar: true);
{
    if (tab1.BeginPage())
    {
        // Draw GUI for the first tab page;
    }
    tab1.EndPage();

    if (tab2.BeginPage())
    {
        // Draw GUI for the second tab page;
    }
    tab2.EndPage();
}
tabGroup.EndGroup();

// Control the animation speed.
tabGroup.AnimationSpeed = 0.2f;

// If true, the tab group will have the height equal to the biggest page. Otherwise the tab group will animate in height as well when changing page.
tabGroup.FixedHeight = true;

// You can change page by calling:
tabGroup.GoToNextPage();
tabGroup.GoToPreviousPage();
See Also

Constructors

GUITabGroup()
public GUITabGroup()

Fields

AnimationSpeed
The animation speed
public float AnimationSpeed
ExpandHeight
public bool ExpandHeight
FixedHeight
public bool FixedHeight
TabLayouting
public TabLayouting TabLayouting

Properties

CurrentPage
Gets the current page.
public GUITabPage CurrentPage { get; }
InnerRect
The inner rect of the current tab page.
public Rect InnerRect { get; }
NextPage
public GUITabPage NextPage { get; }
OuterRect
Gets the outer rect of the entire tab group.
public Rect OuterRect { get; }
T
Gets the t.
public float T { get; }
ToolbarHeight
The height of the tab buttons.
public float ToolbarHeight { get; set; }

Methods

BeginGroup(Boolean, GUIStyle)
Begins the group.
public void BeginGroup(bool drawToolbar = true, GUIStyle style = null)
Parameters
System.Boolean drawToolbar

if set to true a tool-bar for changing pages is drawn.

UnityEngine.GUIStyle style

The style.

EndGroup()
Ends the group.
public void EndGroup()
GoToNextPage()
Goes to next page.
public void GoToNextPage()
GoToPage(GUITabPage)
Goes to page.
public void GoToPage(GUITabPage page)
Parameters
GUITabPage page

GoToPage(String)
public void GoToPage(string pageName)
Parameters
System.String pageName

GoToPreviousPage()
Goes to previous page.
public void GoToPreviousPage()
RegisterTab(String)
Registers the tab.
public GUITabPage RegisterTab(string title)
Parameters
System.String title

Returns
GUITabPage

SetCurrentPage(GUITabPage)
If true, the tab group will have the height equal to the biggest page. Otherwise the tab group will animate in height as well when changing page.
public void SetCurrentPage(GUITabPage page)
Parameters
GUITabPage page

The page to switch to.