コード例 #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.");
            }
        }
コード例 #2
0
 public void ForEach(ButtonInputAction action)
 {
     Solvers.ForEach((solver) => solver.Invoke(action));
 }