示例#1
0
 public MouseInput(Contexts contexts)
 {
     _input       = contexts.input;
     _leftClicks  = _input.GetGroup(InputMatcher.AnyOf(InputMatcher.MouseLeftDown, InputMatcher.MouseLeftReleased));
     _rightClicks = _input.GetGroup(InputMatcher.AnyOf(InputMatcher.MouseRightDown, InputMatcher.MouseRightReleased));
     _mouseHover  = _input.GetGroup(InputMatcher.MouseHover);
 }
示例#2
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(
                                        InputMatcher.AxisInput,
                                        InputMatcher.KeyInput
                                        )));
 }
示例#3
0
        public BuildCommands(Contexts contexts) : base(contexts.input)
        {
            _game    = contexts.game;
            _grid    = UnityEngine.GameObject.FindObjectOfType <HexGridBehaviour>();
            _presets = new Presets(_game, _grid);

            _UICommands = contexts.input.GetGroup(InputMatcher.AnyOf(InputMatcher.UIBuildBarracks, InputMatcher.UIBuildTower));
            _selectedBarracksBuilders = _game.GetGroup(GameMatcher.AllOf(GameMatcher.Selected, GameMatcher.CanBuildBarracks));
            _selectedTowerBuilders    = _game.GetGroup(GameMatcher.AllOf(GameMatcher.Selected, GameMatcher.CanBuildBarracks));
        }
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(new Collector <InputEntity>(
                new[]
     {
         context.GetGroup(InputMatcher
                          .AllOf(
                              InputMatcher.KeyEvent,
                              InputMatcher.KeyHeld
                              )
                          ),
         context.GetGroup(InputMatcher.AnyOf(
                              InputMatcher.MouseScrollDown,
                              InputMatcher.MouseScrollUp
                              ))
     },
                new[]
     {
         GroupEvent.AddedOrRemoved,
         GroupEvent.AddedOrRemoved
     }
                ));
 }
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     // triggers:
     // PointerOverUi.AddedOrRemoved
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.PointerOverUi.AddedOrRemoved().matcher)));
 }
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.MouseClickDown, InputMatcher.MouseClickStay)));
 }
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.ShowUiCommand, InputMatcher.HideUiCommand)));
 }
示例#8
0
        protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
        {
            var matcher = InputMatcher.AnyOf(InputMatcher.Movement, InputMatcher.Attack, InputMatcher.TryingToUseAbility);

            return(context.CreateCollector(matcher));
        }
示例#9
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.InputActionStarted,
                                                       InputMatcher.InputActionEnded, InputMatcher.InputActionActive)));
 }
示例#10
0
 protected override Collector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.NextStepEvent,
                                                       InputMatcher.AllAnimationCompleteComponentI)));
 }
示例#11
0
 protected override ICollector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.MouseLeftDown, InputMatcher.MouseLeftReleased)));
 }
 public EndGameSystem(Contexts contexts, Systems systems) : base(contexts.input)
 {
     this._contexts = contexts;
     this._systems  = systems;
     group          = this._contexts.input.GetGroup(InputMatcher.AnyOf(InputMatcher.EndGame, InputMatcher.DestroyReactiveUI));
 }
示例#13
0
 protected override Collector <InputEntity> GetTrigger(IContext <InputEntity> context)
 {
     return(context.CreateCollector(InputMatcher.AnyOf(InputMatcher.NextStepEvent)));
 }
示例#14
0
 public EmitInputSystem(Contexts contexts)
 {
     _context = contexts.input;
     _inputs  = _context.GetGroup(InputMatcher.AnyOf(InputMatcher.LeftMouse, InputMatcher.MouseDown, InputMatcher.MouseUp, InputMatcher.MousePosition));
 }