Struct SimpleRumble
This class controls the intensity and state of a rumble motor on a single XR device.
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: UnityEngine.Experimental.Input.Plugins.XR.Haptics
Syntax
public struct SimpleRumble
Constructors
SimpleRumble(InputDevice)
Simple constructor that links this SimpleRumble class to a specific device.
Declaration
public SimpleRumble(InputDevice device)
Parameters
Type | Name | Description |
---|---|---|
InputDevice | device | The XR device containing the rumble motor you want to link to. |
Properties
intensity
Determines the rumble intensity. This expects a 0-1 value, where 0 is off, and 1 is the maximum amplitude available to the device
Declaration
public float intensity { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
isPaused
This allows you to pause the actual device motors. This doesn't affect the current intensity, but prevents that intensity from being sent to the device.
Declaration
public bool isPaused { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
isRumbling
A quick accessor to verify that the intensity is greater than 0, and that the rumble motor is not paused.
Declaration
public bool isRumbling { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Reset()
Resets the rumble motor state to defaults, which is an intensity of 0 and unpaused.
Declaration
public void Reset()