protected virtual void Start() { LoadState(); GameObject instance = Instantiate(Resources.Load("Prefab/Scene/FadeCanvas")) as GameObject; m_fadeController = instance.GetComponent <FadeController>(); m_currentState = m_sceneStateList[0]; foreach (var state in m_sceneStateList) { state.Initialize(this); } m_currentState.OnStart(); }
public void ChangeState <T>() { foreach (var state in m_sceneStateList) { //Typeが違う if (state.GetType() != typeof(T)) { continue; } if (m_currentState) { m_currentState.OnRelease(); } m_currentState = state; m_currentState.OnStart(); } }