Beispiel #1
0
        /// <summary>
        /// Starts a configuration for an axis change.
        /// </summary>
        /// <param name="axis">The axis for which a configuration should be added.</param>
        /// <returns>An axis action.</returns>
        public IAxisAction On(Axis axis)
        {
            var action = new AxisAction(axis);
            mAxesActions.Add(axis, action);

            return action;
        }
Beispiel #2
0
        // method to map a joystick axis to an action
        public void MapJoystickAxisAction(Axis nAxis, AxisAction proc)
        {
            AxisMapping map = new AxisMapping();

            map.key    = (int)nAxis + 3;
            map.action = proc;
            m_AxisActionMap.Add(map);
        }
Beispiel #3
0
        // method to map a mouse axis to an action
        public void MapMouseAxisAction(Axis nAxis, AxisAction proc)
        {
            AxisMapping map = new AxisMapping();

            map.key    = (int)nAxis;
            map.action = proc;
            m_AxisActionMap.Add(map);
        }
 public void MapMouseAxisAction(MouseAxis axis, AxisAction proc)
 {
     if (_axisMouseMap.ContainsKey(axis))
     {
         var map = _axisMouseMap[axis];
         map.Action += proc;
     }
     else
     {
         _axisMouseMap.Add(axis, new MouseAxisMapping {
             Axis = axis, Action = proc
         });
     }
 }
 public void MapJoystickAxisAction(int joystick, JoystickAxis axis, AxisAction proc)
 {
     if (_axisJoystickMap[joystick] == null)
     {
         _axisJoystickMap[joystick] = new Dictionary <JoystickAxis, JoystickAxisMapping>();
     }
     if (_axisJoystickMap[joystick].ContainsKey(axis))
     {
         var map = _axisJoystickMap[joystick][axis];
         map.Action += proc;
     }
     else
     {
         _axisJoystickMap[joystick].Add(axis, new JoystickAxisMapping {
             Axis = axis, Action = proc
         });
     }
 }
Beispiel #6
0
    public void IdentifyTheFocusedInputInMatrix()
    {
        if (remappableActionsGroups[focusedLineIndex].actionAndInputs.inputType == InputType.Button)
        {
            currentButtonAction = remappableActionsGroups[focusedLineIndex].actionAndInputs.buttonInfoPlayer1;
        }
        if (remappableActionsGroups[focusedLineIndex].actionAndInputs.inputType == InputType.Axis)
        {
            currentAxisAction = remappableActionsGroups[focusedLineIndex].actionAndInputs.axisInfoPlayer1;
        }

        if (focusedColumnIndex == 0)
        {
            whichPlayerIndex = PlayerIndex.One;
        }
        else if (focusedColumnIndex == 1)
        {
            whichPlayerIndex = PlayerIndex.Two;
        }
    }
Beispiel #7
0
    void OnInputUpdate(Rewired.InputActionEventData data)
    {
        switch (data.actionId)
        {
        case RewiredConsts.Action.MoveHorizontal:
            moveHorizontal = new AxisAction(data);
            break;

        case RewiredConsts.Action.MoveVertical:
            moveVertical = new AxisAction(data);
            break;

        case RewiredConsts.Action.LookHorizontal:
            lookHorizontal = new AxisAction(data);
            break;

        case RewiredConsts.Action.LookVertical:
            lookVertical = new AxisAction(data);
            break;

        case RewiredConsts.Action.Sprint:
            sprint = new ButtonAction(data);
            break;

        case RewiredConsts.Action.Interact:
            interact = new ButtonAction(data);
            break;

        case RewiredConsts.Action.Jump:
            jump = new ButtonAction(data);
            break;

        default:
            break;
        }
    }
 public AxisGesture(InputValue value, AxisAction action)
 {
     InputValue = value;
     AxisAction = action;
 }