Using the acronym KISS, why not simply allow us to get the inputs by device. Controller theController=Input.controller[3];// get the third controller string name=theController.name; bool pressed=theController.button[1].pressed; bool changed=theController.button[1].changed; float axis=theController.axis[0]; You can stick any more complicated stuff over the top of that for users who cant program, but this is what I need.
Sure, you'll be able to do that. The input system handles all input devices, so including mouse and keyboard etc. You can do InputDevice device = InputSystem.devices[0];though you don't know what type of device you get. Or you can do Gamepad gamepad = InputSystem.LookupDevice(typeof(Gamepad), 0);to get the first gamepad. Or just this if you want the most recently used one: Gamepad gamepad = Gamepad.current; Then you can do things like float axis = ((AxisControl)device.controls[0]).value;and bool wasJustPressed = ((ButtonControl)device.controls[1]).wasJustPressed; Or for a more specific type of device, like gamepads: float axis = gamepad.leftStickX.value;and bool wasJustPressed = gamepad.rightTrigger.wasJustPressed;
How do you replace this gloubi boulga in the new iniput system? (it does buttontDown without need of an InputX monob sitting in your scene by tracking querry time) Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; public class InputX { static bool fireDown, firePressed; static float timeLastFireDownQuerry, timeLastFireQuerry; public static bool IsFireButtonDown () { if (Time.time == timeLastFireDownQuerry) { return fireDown; } else { timeLastFireDownQuerry = Time.time; if (fireDown) { fireDown = false; } else if (Input.GetButton ("Fire") || Input.GetAxis ("Fire") > .1f) { fireDown = true; } return fireDown; } } public static bool IsFireButtonPressed () { IsFireButtonDown (); if (Time.time == timeLastFireQuerry) { return firePressed; } else { timeLastFireQuerry = Time.time; firePressed = Input.GetButton ("Fire") || Input.GetAxis ("Fire") > .1f; return firePressed; } } }