v1.3.0 : November release - anyInput, gamepad types, and more !
features:
-
Gamepad type
Gamepads now have a "type" field that will tell you what kind of controller you are holding (Xbox, PS4..) -
inPressedZone property of stick is now a hPressable
This property of sticks, telling you whether they are pushed, switched from being a regular boolean value to a full-fledged button. That means you can access every feature of hPressable, from "justPressed" to long and double presses. You can also write "hinput.gamepad[0].leftStick" to know if it is being pushed in any direction. -
Button list in gamepads
I added a property called "buttons" to gamepads. It's a list of every button, trigger, bumper and stick click of the gamepad. Each of those buttons also has an "index" property that will return its index in this list. This feature is meant to complement the "sticks" property, so that you can iterate on every input of the gamepads. -
anyInput in gamepads
You can now listen to any input from a given gamepad. This property is a hPressable, so it behaves like a button and can be pressed, justPressed, etc. It is considered pressed if any button or stick is pressed, and its position is equal to the most-pushed input of the gamepad. -
Simplified vibrations
Rumble is now much easier to use ! There's only one method called Vibrate, that takes a duration and intensity for both sides. You can omit any of these parameter to replace them with default values, or use no parameter at all !
fixes:
-
hinput now works in WebGL builds
The source of our problems was XInput. If you're making a WebGL project you should either not import the folder from hinput, or delete it. hinput will still work the same, except you won't be able to use vibration. -
hinput now works with old versions of unity
I replaced all the code that was too recent.