Class XRInputHapticImpulseProvider
Serializable haptic impulse provider that allows for specifying the output channel or device for haptic impulses. Behaviors can declare a field of this type to allow them to output haptic impulses to a controller specified by an input action or any other source capable of returning a group of haptic channels.
Implements
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.Inputs.Haptics
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[Serializable]
public class XRInputHapticImpulseProvider : IXRHapticImpulseProvider
Constructors
XRInputHapticImpulseProvider()
Initializes and returns an instance of XRInput
Declaration
public XRInputHapticImpulseProvider()
XRInputHapticImpulseProvider(string, bool, InputSourceMode)
Initializes and returns an instance of XRInput
Declaration
public XRInputHapticImpulseProvider(string name = null, bool wantsInitialStateCheck = false, XRInputHapticImpulseProvider.InputSourceMode inputSourceMode = InputSourceMode.InputActionReference)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the directly serialized embedded input action. |
bool | wantsInitialStateCheck | Whether the action should start performing if already actuated when the action is enabled. |
XRInput |
inputSourceMode | The initial input source mode. |
Properties
inputAction
The directly serialized embedded input action that is read to identify the output channels of a device
when the mode is set to Input
Declaration
public InputAction inputAction { get; set; }
Property Value
Type | Description |
---|---|
Input |
inputActionReference
The reference to an input action that is read to identify the output channels of a device
when the mode is set to Input
Declaration
public InputActionReference inputActionReference { get; set; }
Property Value
Type | Description |
---|---|
Input |
inputSourceMode
The mode that determines from which input source to get the haptic channels.
By default this is set to Input
Declaration
public XRInputHapticImpulseProvider.InputSourceMode inputSourceMode { get; set; }
Property Value
Type | Description |
---|---|
XRInput |
See Also
Methods
DisableDirectActionIfModeUsed()
Disable the directly serialized embedded input action if the mode is set to Input
Declaration
public void DisableDirectActionIfModeUsed()
See Also
EnableDirectActionIfModeUsed()
Enable the directly serialized embedded input action if the mode is set to Input
Declaration
public void EnableDirectActionIfModeUsed()
See Also
GetChannelGroup()
Gets the group of haptic impulse channels.
Declaration
public IXRHapticImpulseChannelGroup GetChannelGroup()
Returns
Type | Description |
---|---|
IXRHaptic |
Returns the haptic impulse channel group, which may be null. |
GetObjectReference()
Gets the object reference that is used as the input source to identify the output channels of a device
when the mode is set to Object
Declaration
public IXRHapticImpulseProvider GetObjectReference()
Returns
Type | Description |
---|---|
IXRHaptic |
Returns the object reference, which may be null. |
SetObjectReference(IXRHapticImpulseProvider)
Sets the object reference that is used as the input source to identify the output channels of a device
when the mode is set to Object
Declaration
public void SetObjectReference(IXRHapticImpulseProvider value)
Parameters
Type | Name | Description |
---|---|---|
IXRHaptic |
value | The object reference. |
Remarks
If the argument is to be serialized, it must be a Unity Object type.