Files
FutureMen/Assets/Scripts/UI/UIState.cs
2025-07-10 14:34:41 +08:00

28 lines
552 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UIState : MonoBehaviour
{
public int nowState = 0;
public void StateChange(int v)
{
int index = 0;
foreach (Transform child in this.transform)
{
if (index == v)
{
this.nowState = v;
child.gameObject.SetActive(true);
}
else
{
child.gameObject.SetActive(false);
}
index++;
}
}
}