namespace UIWidgets
{
using UIWidgets.l10n;
using UnityEngine;
using UnityEngine.UI;
///
/// TabIconButton.
///
public class TabIconButtonBase : TabButton
{
///
/// The name.
///
[SerializeField]
public TextAdapter NameAdapter;
///
/// The icon.
///
[SerializeField]
public Image Icon;
///
/// The size of the set native.
///
[SerializeField]
public bool SetNativeSize;
///
/// Sets the data.
///
/// Tab.
public override void SetData(TabIcons tab)
{
NameAdapter.text = Localization.GetTranslation(tab.Name);
if (Icon != null)
{
Icon.sprite = tab.IconDefault;
if (SetNativeSize)
{
Icon.SetNativeSize();
}
Icon.color = (Icon.sprite == null) ? Color.clear : Color.white;
}
}
}
}