Ejemplo n.º 1
0
        public void Execute(InputAction action)
        {
            var alias = MappedInput(action.Name);

            switch (action)
            {
            case ButtonInputAction button:
                if (ButtonInputAction.ContainsKey(alias))
                {
                    ButtonInputAction[alias]?.ForEach(button);
                }
                break;

            case AxisInputAction axis:
                if (AxisInputAction.ContainsKey(alias))
                {
                    AxisInputAction[MappedInput(axis.Name)]?.ForEach(axis);
                }
                break;

            case CharInputAction charInput:
                if (CharInputAction.ContainsKey(alias))
                {
                    CharInputAction[MappedInput(charInput.Name)]?.ForEach(charInput);
                }
                break;

            default: throw new Exception("Invalid Input Action.");
            }
        }
Ejemplo n.º 2
0
 public void ForEach(AxisInputAction action)
 {
     Solvers.ForEach((solver) => solver.Invoke(action));
 }