Beispiel #1
0
    protected override void Awake()
    {
        _inputValueActions  = GetComponentInChildren <InputValueActions>();
        _inputButtonActions = GetComponentInChildren <InputButtonActions>();

        base.Awake();
    }
Beispiel #2
0
        public void EnableButton(InputButtons button, InputButtonActions action)
        {
            switch (action)
            {
            case InputButtonActions.Down:
                buttonDownEvents.First(b => b.Key == button).Value.Enable();
                break;

            case InputButtonActions.Hold:
                buttonHoldEvents.First(b => b.Key == button).Value.Enable();
                break;

            case InputButtonActions.Up:
                buttonUpEvents.First(b => b.Key == button).Value.Enable();
                break;
            }
        }
Beispiel #3
0
        public void RegisterButton(InputButtons button, InputButtonActions action, Action callback)
        {
            switch (action)
            {
            case InputButtonActions.Down:
                buttonDownEvents.Add(button, new InputEvent(callback));
                break;

            case InputButtonActions.Hold:
                buttonHoldEvents.Add(button, new InputEvent(callback));
                break;

            case InputButtonActions.Up:
                buttonUpEvents.Add(button, new InputEvent(callback));
                break;
            }
        }
Beispiel #4
0
 public void DisableEvent(InputContexts context, InputButtons button, InputButtonActions action)
 {
     GetByContext(context).DisableButton(button, action);
 }
Beispiel #5
0
 public void RegisterEvent(InputContexts context, InputButtons button, InputButtonActions action, Action callback)
 {
     GetByContext(context).RegisterButton(button, action, callback);
 }