Wiki

Clone wiki

VRInputSystem / Home

Usage

To use this input manager in your Unity project follow these instructions:

  1. Clone these files somewhere in your Unity project.

  2. Place the InputManager component on an object somewhere in your scene and configure the inputs you'd like to use.

  3. Place an InputState component on an object somewhere in your scene.

  4. During play mode the input state component will have the current values set for each of your game actions so you can easily see if they were pressed or their values.

#!c#

var actionState = inputState.GetActionState(action);
//do something if the action is pressed
if(actionState.isPressed){/* do something */}
//do something if the action value is bigger than 0.6
if(actionState.value > 0.6f) { /* do something */ }

ToDo

  • Investigate changing enumeration based action selection to string based along with a custom editor drop down list so that users don't have to modify the enumerations.
  • Create custom editor extension so that I can mix VR and traditional input types in a unity list and simplify InputManager
  • Add Macro support
  • Investigate a possibility to have it run before all other update methods without needing the set script execution order

Hope you'll find this project useful!

Updated