Inherits SingletonBehaviour< NRInput >.
Public Member Functions | |
string | GetVersion (int index) |
Static Public Member Functions | |
static void | SetDomainHandMode (ControllerHandEnum handEnum) |
static bool | SetInputSource (InputSourceEnum inputSourceType) |
static int | GetAvailableControllersCount () |
static ControllerType | GetControllerType () |
static ControllerConnectionState | GetControllerConnectionState () |
static bool | CheckControllerAvailable (ControllerHandEnum handEnum) |
static bool | GetControllerAvailableFeature (ControllerAvailableFeature feature) |
static bool | GetButton (ControllerButton button) |
static bool | GetButtonDown (ControllerButton button) |
static bool | GetButtonUp (ControllerButton button) |
static bool | IsTouching () |
static Vector2 | GetTouch () |
static Vector2 | GetDeltaTouch () |
static Vector3 | GetPosition () |
static Quaternion | GetRotation () |
static Vector3 | GetGyro () |
static Vector3 | GetAccel () |
static Vector3 | GetMag () |
static int | GetControllerBattery () |
static void | TriggerHapticVibration (float durationSeconds=0.1f, float frequency=200f, float amplitude=0.8f) |
static bool | GetButton (ControllerHandEnum hand, ControllerButton button) |
static bool | GetButtonDown (ControllerHandEnum hand, ControllerButton button) |
static bool | GetButtonUp (ControllerHandEnum hand, ControllerButton button) |
static bool | IsTouching (ControllerHandEnum hand) |
static Vector2 | GetTouch (ControllerHandEnum hand) |
static Vector2 | GetDeltaTouch (ControllerHandEnum hand) |
static Vector3 | GetPosition (ControllerHandEnum hand) |
static Quaternion | GetRotation (ControllerHandEnum hand) |
static Vector3 | GetGyro (ControllerHandEnum hand) |
static Vector3 | GetAccel (ControllerHandEnum hand) |
static Vector3 | GetMag (ControllerHandEnum hand) |
static int | GetControllerBattery (ControllerHandEnum hand) |
static void | TriggerHapticVibration (ControllerHandEnum hand, float durationSeconds=0.1f, float frequency=200f, float amplitude=0.8f) |
static void | RecenterController () |
static void | AddDownListener (ControllerHandEnum hand, ControllerButton button, Action action) |
static void | RemoveDownListener (ControllerHandEnum hand, ControllerButton button, Action action) |
static void | AddPressingListener (ControllerHandEnum hand, ControllerButton button, Action action) |
static void | RemovePressingListener (ControllerHandEnum hand, ControllerButton button, Action action) |
static void | AddUpListener (ControllerHandEnum hand, ControllerButton button, Action action) |
static void | RemoveUpListener (ControllerHandEnum hand, ControllerButton button, Action action) |
static void | AddClickListener (ControllerHandEnum hand, ControllerButton button, Action action) |
static void | RemoveClickListener (ControllerHandEnum hand, ControllerButton button, Action action) |
Static Public Attributes | |
const int | MAX_CONTROLLER_STATE_COUNT = 2 |
static Action< ControllerHandEnum > | OnDomainHandChanged |
static Action | OnControllerConnected |
static Action | OnControllerDisconnected |
static Action | OnBeforeControllerRecenter |
static Action | OnControllerRecentered |
static Action | OnControllerStatesUpdated |
static NRHandsManager | Hands = new NRHandsManager() |
Properties | |
static bool | ReticleVisualActive [getset] |
static bool | LaserVisualActive [getset] |
static bool | ControllerVisualActive [getset] |
static bool | HapticVibrationEnabled [getset] |
static bool | RaycastersActive [getset] |
static bool? | EmulateVirtualDisplayInEditor [get] |
static ControllerAnchorsHelper | AnchorsHelper [get] |
static ControllerHandEnum | DomainHand [get] |
static RaycastModeEnum | RaycastMode [getset] |
static InputSourceEnum | CurrentInputSourceType [get] |
static float | ClickInterval [getset] |
static float | DragThreshold [getset] |
static Transform | CameraCenter [get] |
Detailed Description
The main class to handle controller related things, such as to get controller states, update controller states Through this class, application would create a controllerProvider which could be custom, then the controllerProvider iteself would define how to update the controller states, so that every frame NRInput could get the right states.There are max two states for one controllerProvider.
Member Function Documentation
◆ AddClickListener()
|
static |
Add button click event listerner.
- Parameters
-
hand The hand. button The button. action The action.
◆ AddDownListener()
|
static |
Add button down event listerner.
- Parameters
-
hand The hand. button The button. action The action.
◆ AddPressingListener()
|
static |
Add button pressing event listerner.
- Parameters
-
hand The hand. button The button. action The action.
◆ AddUpListener()
|
static |
Add button up event listerner.
- Parameters
-
hand The hand. button The button. action The action.
◆ CheckControllerAvailable()
|
static |
Returns true if the controller is available.
- Parameters
-
handEnum .
- Returns
- True if it succeeds, false if it fails.
◆ GetAccel() [1/2]
|
static |
Returns the accel sensor value of the domain controller.
- Returns
- The accel.
◆ GetAccel() [2/2]
|
static |
Returns the accel sensor value of a certain handedness controller.
- Parameters
-
hand The hand.
- Returns
- The accel.
◆ GetAvailableControllersCount()
|
static |
Get the current count of controllers which are connected and available.
- Returns
- The available controllers count.
◆ GetButton() [1/2]
|
static |
Returns true if the button is currently pressed this frame.
- Parameters
-
button The button.
- Returns
- True if it succeeds, false if it fails.
◆ GetButton() [2/2]
|
static |
Returns true if the button is currently pressed this frame on a certain handedness controller.
- Parameters
-
hand The hand. button The button.
- Returns
- True if it succeeds, false if it fails.
◆ GetButtonDown() [1/2]
|
static |
Returns true if the button was pressed down this frame.
- Parameters
-
button The button.
- Returns
- True if it succeeds, false if it fails.
◆ GetButtonDown() [2/2]
|
static |
Returns true if the button was pressed down this frame on a certain handedness controller.
- Parameters
-
hand The hand. button The button.
- Returns
- True if it succeeds, false if it fails.
◆ GetButtonUp() [1/2]
|
static |
Returns true if the button was released this frame.
- Parameters
-
button The button.
- Returns
- True if it succeeds, false if it fails.
◆ GetButtonUp() [2/2]
|
static |
Returns true if the button was released this frame on a certain handedness controller.
- Parameters
-
hand The hand. button The button.
- Returns
- True if it succeeds, false if it fails.
◆ GetControllerAvailableFeature()
|
static |
Returns true if the current controller supports the certain feature.
- Parameters
-
feature The feature.
- Returns
- True if it succeeds, false if it fails.
◆ GetControllerBattery() [1/2]
|
static |
Returns the battery level of the domain controller.
- Returns
- The controller battery.
◆ GetControllerBattery() [2/2]
|
static |
Returns the battery level of a certain handedness controller, range from 0 to 100.
- Parameters
-
hand The hand.
- Returns
- The controller battery.
◆ GetControllerConnectionState()
|
static |
Get the ConnectionState of current controller.
- Returns
- The controller connection state.
◆ GetControllerType()
|
static |
Get the ControllerType of current controller.
- Returns
- The controller type.
◆ GetDeltaTouch() [1/2]
|
static |
Returns a Vector2 delta touch value on touchpad of the domain controller.
- Returns
- The delta touch.
◆ GetDeltaTouch() [2/2]
|
static |
Returns a Vector2 delta touch value on touchpad of a certain handedness controller.
- Parameters
-
hand The hand.
- Returns
- The delta touch.
◆ GetGyro() [1/2]
|
static |
Returns the gyro sensor value of the domain controller.
- Returns
- The gyro.
◆ GetGyro() [2/2]
|
static |
Returns the gyro sensor value of a certain handedness controller.
- Parameters
-
hand The hand.
- Returns
- The gyro.
◆ GetMag() [1/2]
|
static |
Returns the magnetic sensor value of the domain controller.
- Returns
- The magnitude.
◆ GetMag() [2/2]
|
static |
Returns the magnetic sensor value of a certain handedness controller.
- Parameters
-
hand The hand.
- Returns
- The magnitude.
◆ GetPosition() [1/2]
|
static |
Returns the current position of the domain controller if 6dof, otherwise returns Vector3.zero.
- Returns
- The position.
◆ GetPosition() [2/2]
|
static |
Returns the current position of a certain handedness controller if 6dof, otherwise returns Vector3.zero.
- Parameters
-
hand The hand.
- Returns
- The position.
◆ GetRotation() [1/2]
|
static |
Returns the current rotation of the domain controller.
- Returns
- The rotation.
◆ GetRotation() [2/2]
|
static |
Returns the current rotation of a certain handedness controller.
- Parameters
-
hand The hand.
- Returns
- The rotation.
◆ GetTouch() [1/2]
|
static |
Returns a Vector2 touch position on touchpad of the domain controller, range: x(-1f ~ 1f), y(- 1f ~ 1f)
- Returns
- The touch.
◆ GetTouch() [2/2]
|
static |
Returns a Vector2 touch position on touchpad of a certain handedness controller, range: x(-1f ~ 1f), y(-1f ~ 1f)
- Parameters
-
hand The hand.
- Returns
- The touch.
◆ GetVersion()
string NRKernal.NRInput.GetVersion | ( | int | index | ) |
Gets a version.
- Parameters
-
index Zero-based index of the.
- Returns
- The version.
◆ IsTouching() [1/2]
|
static |
Returns true if the touchpad is being touched.
- Returns
- True if touching, false if not.
◆ IsTouching() [2/2]
|
static |
Returns true if the touchpad is being touched this frame on a certain handedness controller.
- Parameters
-
hand The hand.
- Returns
- True if touching, false if not.
◆ RemoveClickListener()
|
static |
Remove button click event listerner.
- Parameters
-
hand The hand. button The button. action The action.
◆ RemoveDownListener()
|
static |
Remove button down event listerner.
- Parameters
-
hand The hand. button The button. action The action.
◆ RemovePressingListener()
|
static |
Remove button pressing event listerner.
- Parameters
-
hand The hand. button The button. action The action.
◆ RemoveUpListener()
|
static |
Remove button up event listerner.
- Parameters
-
hand The hand. button The button. action The action.
◆ SetDomainHandMode()
|
static |
Set the current enumeration of handedness.
- Parameters
-
handEnum .
◆ SetInputSource()
|
static |
Set the current input source.
- Parameters
-
inputSourceType
- Returns
- The result of setting input source.
◆ TriggerHapticVibration() [1/2]
|
static |
Trigger vibration of a certain handedness controller.
- Parameters
-
hand The hand. durationSeconds (Optional) The duration in seconds. frequency (Optional) The frequency. amplitude (Optional) The amplitude.
◆ TriggerHapticVibration() [2/2]
|
static |
Trigger vibration of the domain controller.
- Parameters
-
durationSeconds (Optional) The duration in seconds. frequency (Optional) The frequency. amplitude (Optional) The amplitude.
Property Documentation
◆ AnchorsHelper
|
staticget |
It's a helper to get controller anchors which are frequently used.
The anchors helper.
◆ CameraCenter
|
staticget |
Get the transform of the camera which controllers are following.
The camera center.
◆ ClickInterval
|
staticgetset |
Get and set button click interval.
The click interval.
◆ ControllerVisualActive
|
staticgetset |
Determine whether to show controller visuals, could be get and set at runtime.
True if controller visual active, false if not.
◆ CurrentInputSourceType
|
staticget |
Get the current input source type.
The input source type.
◆ DomainHand
|
staticget |
Get the current enumeration of handedness.
The domain hand.
◆ DragThreshold
|
staticgetset |
Get and set pointer drag threshold.
The drag threshold.
◆ EmulateVirtualDisplayInEditor
|
staticget |
Determine whether emulate phone virtual display in Unity Editor.
True if emulate virtual display in editor, false if not.
◆ HapticVibrationEnabled
|
staticgetset |
Determine whether enable haptic vibration.
True if haptic vibration enabled, false if not.
◆ LaserVisualActive
|
staticgetset |
Determine whether to show laser visuals, could be get and set at runtime.
True if laser visual active, false if not.
◆ RaycastersActive
|
staticgetset |
Determine whether to active raycaster gameobjects, could be get and set at runtime.
True if active raycaster gameobjects, false if not.
◆ RaycastMode
|
staticgetset |
Determine which raycast mode to use.
The raycast mode.
◆ ReticleVisualActive
|
staticgetset |
Determine whether to show reticle visuals, could be get and set at runtime.
True if reticle visual active, false if not.