Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Rewired;
- using UnityEngine;
- public class RewiredTest : MonoBehaviour
- {
- private Player player;
- // Start is called before the first frame update
- void Awake()
- {
- player = ReInput.players.GetPlayer(0);
- }
- // Update is called once per frame
- void Update()
- {
- //Input for Left Stick
- float horizontal = player.GetAxis("Move Horizontal");
- float vertical = player.GetAxis("Move Vertical");
- //--------- Input for Joystick --------------
- if (new Vector2(horizontal, vertical) != Vector2.zero)
- {
- //DO SOMETHING
- }
- //--------- Input for D-Pad --------------
- if (player.GetButtonDown("Up"))
- {
- //DO SOMETHING
- }
- if (player.GetButtonDown("Down"))
- {
- //DO SOMETHING
- }
- if (player.GetButtonDown("Left"))
- {
- //DO SOMETHING
- }
- if (player.GetButtonDown("Right"))
- {
- //DO SOMETHING
- }
- //--------- Input for Buttons --------------
- if (player.GetButtonDown("Trigger")) //Down
- {
- //DO SOMETHING
- }
- if (player.GetButton("Trigger")) //Held
- {
- //DO SOMETHING
- }
- if (player.GetButtonUp("Trigger")) //Up
- {
- //DO SOMETHING
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement