Files
valheim/Assets/_Valheim/Scripts/UI/State.cs
2025-07-04 14:16:14 +08:00

50 lines
1.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Common
{
public class State : 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++;
// }
}
public void StateChangeBgm(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++;
}
}
}
}