Input Module Manager

Introduction

Unity provides Event System to receive input from standard I/O and communicate among different Game Objects.

WaveVR provides a prefab InputModuleManager with script WaveVR_InputModuleManager to use Event System easily.

Note: prefab InputModuleManager uses Head’s local position & rotation, it will be possible to have abnormal behavior if being put under another GameObject.

Resources

Prefab InputModuleManager locates in Assets/WaveVR/Prefabs/

Script WaveVR_InputModuleManager locates in Assets/WaveVR/Scripts/EventSystem/

Scripts

Default values of options of WaveVR_InputModuleManager are shown as the photo:

_images/WaveVR_InputModuleManager_01.png

Enable Input Module

This option can be selected/unselected to enable/disable Input Module .

It affects only the Event System

Override System Settings

WaveVR provide Gaze and Controller input module. The default is Controller.

If this option is unselected, WaveVR_InputModuleManager will use controller Input Module.

By selecting this option, developer can choose the Custom Input Module:

_images/WaveVR_InputModuleManager_02.png _images/WaveVR_InputModuleManager_03.png

The options of controller Custom Input Module is equivallent to WaveVR_ControllerInputModule except for

  • Raycast Mode has three options: Mouse, Fixed and Beam.

    Mouse mode: You can trigger object event through the pointer of controller.

    Fixed mode: The beam length is fixed and you can trigger object event through the intersection of controller beam and object.

    Beam mode: The location of controller pointer will move to the intersection of controller beam and object, you can trigger object event through the intersection of controller beam and object.

  • Raycast Start Point means the location of raycast event camera of mouse mode, there are three options (Center Of Eyes, Left Eye and Right Eye).

The options of gaze Custom Input Module is equivalent to WaveVR_Gaze

Knack

How to enable/disable input module in runtime?

WaveVR_InputModuleManager.Instance.EnableInputModule = true;    // or false

How to switch Custom Input Module in runtime?

WaveVR_InputModuleManager.Instance.CustomInputModule = WaveVR_EInputModule.Controller;  // or WaveVR_EInputModule.Gaze;