using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using System.Collections.Generic;
using System.Linq;
using System;
namespace UIWidgets
{
///
/// TabSelectEvent.
///
[Serializable]
public class TabSelectEvent : UnityEvent
{
}
///
/// Tabs.
/// http://ilih.ru/images/unity-assets/UIWidgets/Tabs.png
///
[AddComponentMenu("UI/UIWidgets/Tabs")]
public class Tabs : MonoBehaviour
{
///
/// The container for tab toggle buttons.
///
[SerializeField]
public Transform Container;
///
/// The default tab button.
///
[SerializeField]
public Button DefaultTabButton;
///
/// The active tab button.
///
[SerializeField]
public Button ActiveTabButton;
[SerializeField]
Tab[] tabObjects = new Tab[]{};
///
/// Gets or sets the tab objects.
///
/// The tab objects.
public Tab[] TabObjects {
get {
return tabObjects;
}
set {
tabObjects = value;
UpdateButtons();
}
}
///
/// The name of the default tab.
///
[SerializeField]
[Tooltip("Tab name which will be active by default, if not specified will be opened first Tab.")]
public string DefaultTabName = string.Empty;
///
/// If true does not deactivate hidden tabs.
///
[SerializeField]
[Tooltip("If true does not deactivate hidden tabs.")]
public bool KeepTabsActive = false;
///
/// OnTabSelect event.
///
[SerializeField]
public TabSelectEvent OnTabSelect = new TabSelectEvent();
///
/// Gets or sets the selected tab.
///
/// The selected tab.
public Tab SelectedTab {
get;
protected set;
}
List