b3x206 / unity-tabsystem

Unity UI tab menus.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity Tab System

CodeFactor

Use this tab system to easily create tabs in your UI. (like the browser tabs or menu tabs)

Notes :

Before usage, make sure to import TextMeshPro text.

How To Import

Preview :

Scene Scene

Font Used In The Previews

Code :

// Reference to the tab system.
public TabSystem tabSystem;

void Start()
{
    // Register event
    tabSystem.OnTabButtonsClicked.AddListener(EventExample);
    // Sets current selected tab to index (if the index exists)
    tabSystem.SetSelectedButtonIndex(2);
    // Sets tab button amount (this generates tabs if the count isn't already 4)
    tabSystem.TabButtonAmount = 4;
}

// ...
// Register this event from inspector if you want, using the unity event.
public void EventExample(int SelectedTabIndex)
{
    // Information
    Debug.Log(string.Format("Selected tab was : {0}", SelectedTabIndex));
    // Toggle menus from here.
}

Documentation :

  • Documentation will be added as a wiki page, but this is the quick start thing.
  • Create tab using GameObject>UI>TabSystem
  • Just play with the 'TabAmount' and use the 'CurrentReferenceTabIndex' variable for which tab to instantiate from.
  • Use the inspector (like you would do on a GameObject>UI>Button) to attach events and change stuff to your liking.

Licensing :

This repository is dual licensed to be both unlicense/public domain and/or MIT license. Use the one that is suitable for you and your organization.

About

Unity UI tab menus.

License:The Unlicense


Languages

Language:C# 100.0%