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