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++; } } } }