Files
FutureMen2/Assets/_FutureMen2/Scripts/UI/UIState.cs
2026-01-05 11:00:50 +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++;
}
}
}