public MainMenuState(SceneStateControl controller) : base("02MainMenuState", controller) { }
//private GameFacade m_Facade; //外观模式的引用 public BattleState(SceneStateControl controller) : base("03BattleState", controller) { }
void Start() { controller = new SceneStateControl(); //不加载场景,因为当前就是StartState场景 controller.SetState(new StartState(controller), false); }
protected SceneStateControl m_controller; //状态拥有者 public ISceneState(string sceneName, SceneStateControl controller) { m_SceneName = sceneName; m_controller = controller; }
//本类构造方法 并调用基类的构造方法 public StartState(SceneStateControl controller) : base("01StartState", controller) { }