private StateBase whoIsGod() { State state = TaskState.Create(delegate { if (_hasAnchor) { Root.Instance.view.board.state = InfoBoard.State.Hide; } else { Root.Instance.view.board.state = InfoBoard.State.Scan; } Task task = new Task(); TaskManager.AddAndIsOver(task, delegate { return(Root.Instance.model.hasGod); }); return(task); }, this.fsm_, "running"); state.addAction(Ctrl.AnchorEvent, delegate { WhoIsGod wid = Altar.LocalComponent <WhoIsGod>(); wid.IAmGod(); }); state.onStart += delegate { _stateName = "whoIsGod"; Debug.Log("state:" + _stateName); }; return(state); }
private StateBase alone() { State state = TaskState.Create(delegate { WhoIsGod wid = null; Task task = new Task(); TaskManager.AddAndIsOver(task, delegate { wid = Altar.LocalComponent <WhoIsGod>(); return(wid != null); }); TaskManager.PushBack(task, delegate { wid.IAmGod(); }); return(task); }, this.fsm_, "running"); return(state); }