Beispiel #1
0
    private void InitInput()
    {
        pcInputActions.Player.Action1.performed += OnAction1;
        pcInputActions.Player.Action2.performed += OnAction2;
        pcInputActions.Player.Action3.performed += OnAction3;
        pcInputActions.Player.Action4.performed += OnAction4;

        pcInputActions.Enable();
    }
Beispiel #2
0
        // TODO - add input to its own script? maybe move and some other shared variables can be stored in
        //		  scriptable objects. Benefit of this is other scripts can easily check these values if needed
        //		- not all scripts may be attached to a collider ie. system that monitors player speed
        private void InitInput()
        {
            pcInputActions.Player.Move.performed       += OnMove;
            pcInputActions.Player.Move.canceled        += StopMove;
            pcInputActions.Player.ButtonMove.performed += OnDPadMove;
            pcInputActions.Player.ButtonMove.canceled  += StopMove;

            pcInputActions.Player.Jump.performed += OnJumpPress;
            pcInputActions.Player.Jump.canceled  += OnJumpRelease;

            pcInputActions.Player.Action1.performed += OnAction1;

            pcInputActions.Player.Action2.performed += OnAction2;

            pcInputActions.Player.Action3.performed += OnAction3;

            pcInputActions.Player.Menu.performed += OnMenu;

            pcInputActions.Enable();
        }