//添加到管理器 public void RegiestScene(string sname, ISceneState scenestate) { // Debug.Log("regiestScene ="+scenestate.StateName); if (!sceneStateDic.ContainsKey(sname)) { sceneStateDic.Add(sname, scenestate); } }
//设置状态 public void SetState(ISceneState State, string loadSceneName) { if (loadSceneName != "") { LoadScene(loadSceneName); } if (m_State != null) { m_State.StateEnd(); } m_State = State; }
public void LoadScene(string loadSceneName) { if (sceneStateDic.ContainsKey(loadSceneName)) { ISceneState scenestate = sceneStateDic[loadSceneName]; if (scenestate != null) { lastSceneName = curSceneName; curSceneName = loadSceneName; mController.SetState(scenestate, loadSceneName); } } }