Esempio n. 1
0
    public PlayerInput(int ID) : base()
    {
        player = ReInput.players.GetPlayer(ID);


        EventManager.Subscribe <InputActionEventData>(RewiredInputProvider.EVT_INPUT_PRESS, (input) =>
        {
            if (isActive)
            {
                switch (input.actionId)
                {
                case RewiredConsts.Action.MoveHorizontal:
                    LeftStick.SetX(input.GetAxis());
                    LeftStick.Press();
                    break;

                case RewiredConsts.Action.MoveVertical:
                    LeftStick.SetY(input.GetAxis());
                    LeftStick.Press();
                    break;

                case RewiredConsts.Action.CameraHorizontal:
                    RightStick.SetX(input.GetAxis());
                    RightStick.Press();
                    break;

                case RewiredConsts.Action.CameraVertical:
                    RightStick.SetY(input.GetAxis());
                    RightStick.Press();
                    break;
                }
            }
        });
    }
Esempio n. 2
0
 public void PressRightStick(float x, float y)
 {
     RightStick.SetX(x);
     RightStick.SetY(y);
     RightStick.Press();
 }