1
0
Fork 0
LaboratoryProtection/Assets/UnityTest/UI/Scripts/Other/UITopController.cs

30 lines
514 B
C#
Raw Normal View History

2023-09-12 15:55:51 +08:00
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