mirror of
https://github.com/peng-zhihui/ElectronBot.git
synced 2026-10-22 07:06:06 +08:00
43 lines
771 B
C#
43 lines
771 B
C#
namespace UIWidgets
|
|
{
|
|
using UIWidgets.l10n;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Tab component.
|
|
/// </summary>
|
|
public class TabButtonComponentBase : MonoBehaviour, IUpgradeable
|
|
{
|
|
/// <summary>
|
|
/// The name.
|
|
/// </summary>
|
|
[SerializeField]
|
|
public TextAdapter NameAdapter;
|
|
|
|
/// <summary>
|
|
/// Sets the data.
|
|
/// </summary>
|
|
/// <param name="tab">Tab.</param>
|
|
public virtual void SetButtonData(Tab tab)
|
|
{
|
|
NameAdapter.text = Localization.GetTranslation(tab.Name);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Upgrade this instance.
|
|
/// </summary>
|
|
public virtual void Upgrade()
|
|
{
|
|
}
|
|
|
|
#if UNITY_EDITOR
|
|
/// <summary>
|
|
/// Validate this instance.
|
|
/// </summary>
|
|
protected virtual void OnValidate()
|
|
{
|
|
Compatibility.Upgrade(this);
|
|
}
|
|
#endif
|
|
}
|
|
} |