daemon3000 / InputManager

Custom InputManager for Unity
Other
587 stars 88 forks source link

Is it possible to "fake" an axis #4

Closed rbozan closed 9 years ago

rbozan commented 9 years ago

Is it possible to like set an axis value for that current frame to something of your likening? This would really be useful for platforms like mobile where you could set the axis value when for example you are tilting your phone. Something like this for example: InpitManager.SetAxisValue("Horizontal", 0.9);

This would really really really be useful. If you could use it for 1 frame as example, or set it for always, it could really be handy for cross platform inputs or other ways to manipulate the axis

rbozan commented 9 years ago

What also could be an alternative to this is to have an axis in the input manager where it could tilt the device. So you can actually have an other configuration made for mobile, instead of only controller + pc

daemon3000 commented 9 years ago

I added a new type of axis called ManualAxis. This axis type doesn't do anything by default. You have to call InputManager.SetManualAxisValue to update the value of a manual axis. You can call this method at any time but it's best if you subscribe to the ManualUpdate event of the input manager class and update the value when the event is fired. This way all axes(manual or not) will be updated at the same time.

Things you should keep in mind about manual axes:

manual_axis