forked from zxl/LaboratoryProtection
30 lines
514 B
C#
30 lines
514 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public partial class UITopController : BaseBehaviour
|
|
{
|
|
[SerializeField]
|
|
private Toggle[] _topToggles;
|
|
|
|
private void Reset()
|
|
{
|
|
_topToggles = this.GetComponentsInChildren<Toggle>(true);
|
|
}
|
|
|
|
public void SetIndex(int index)
|
|
{
|
|
foreach (var toggle in _topToggles)
|
|
{
|
|
toggle.isOn = false;
|
|
}
|
|
_topToggles[index].isOn = true;
|
|
}
|
|
}
|
|
|
|
#if UNITY_EDITOR
|
|
public partial class UITopController
|
|
{
|
|
|
|
}
|
|
#endif
|