IEnumerator TypeSelect() { var type = Type.Host; using (var ui = new UIStream()) { var selectui = ui.Render <SelectListUi, SelectUIModel>(new SelectUIModel() { PrefabPath = PrefabModel.Path.VerticalSelectList, ChildUIModel = new SelectItemUIModel() { PrefabPath = PrefabModel.Path.VerticalSelectItem, } }.FromEnum <Type>(menu => type = menu)); yield return(selectui.WaitForSelect()); } switch (type) { case Type.Host: _statemachine.Next(State.Host); break; case Type.Client: _statemachine.Next(State.Client); break; } yield return(null); }
IEnumerator Select() { Debug.Log("[MenuSequence] Select"); var turnEnd = false; while (!turnEnd) { MenuType selected = MenuType.Dice; using (var ui = new UIStream()) { //プレイヤーの情報を表示 PlayerManager.Instance.CurrentPlayerModel.Parent = PrefabManager.Instance.Canvas.transform; var playerUI = ui.Render <PlayerUIView, PlayerModel>(PlayerManager.Instance.CurrentPlayerModel); //入力まち yield return(InputManager.Instance.WaitForSelect <MenuType>( PlayerManager.Instance.CurrentPlayerModel, select => { selected = select; })); } OnSelectMenu?.Invoke(); switch (selected) { case MenuType.Dice: yield return(new DiceSequence(seq => { seq.Game = Game; seq.OnUseTurnAction.AddListener(() => turnEnd = true); })); break; case MenuType.Item: break; case MenuType.Magic: break; case MenuType.Data: break; case MenuType.WatchMap: break; } } //_nestSequence?.Init(); _statemachine.Next(State.End); }
public override IEnumerator WaitForButton(string text, Vector2 pos = default, Action cb = null) { pos = pos == null ? Vector2.zero : pos; using (var ui = new UIStream()) { var button = ui.Render <ButtonUI, ButtonUIModel>(new ButtonUIModel() { PrefabPath = PrefabModel.Path.Button, Label = text, Position = pos }); yield return(button.WaitForClick()); } cb?.Invoke(); }
public override IEnumerator WaitForSelect <T>(Action <T> cb) { using (var ui = new UIStream()) { var select = ui.Render <SelectListUi, SelectUIModel>(new SelectUIModel() { PrefabPath = PrefabModel.Path.VerticalSelectList, ChildUIModel = new SelectItemUIModel() { PrefabPath = PrefabModel.Path.VerticalSelectItem, } }.FromEnum <T>(cb)); yield return(select.WaitForSelect()); } }
public override IEnumerator WaitForSelect(string[] list, Action <int> cb) { using (var ui = new UIStream()) { var select = ui.Render <SelectListUi, SelectUIModel>(new SelectUIModel() { Labels = list, Callback = cb, PrefabPath = PrefabModel.Path.VerticalSelectList, ChildUIModel = new SelectItemUIModel() { PrefabPath = PrefabModel.Path.VerticalSelectItem, } }); yield return(select.WaitForSelect()); } }
IEnumerator Select() { using (var ui = new UIStream()) { var selectui = ui.Render <SelectListUi, SelectUIModel>(new SelectUIModel() { PrefabPath = PrefabModel.Path.VerticalSelectList, ChildUIModel = new SelectItemUIModel() { PrefabPath = PrefabModel.Path.VerticalSelectItem, } }.FromEnum <MenuType>(OnSelectMenu.Invoke)); yield return(selectui.WaitForSelect()); } _statemachine.Next(State.End); yield return(null); }