Provides playback functionality for a single haptic clip by wrapping HapticClipPlayer.
If you don't need a MonoBehaviour and a C# class would be more suitable, use HapticClipPlayer instead. It has the same functionality.
Once you have assigned a HapticClip to the clip property you can play the HapticSource, enable or disable looping, and modulate the amplitude and frequency.
You can place multiple HapticSource components in your scene, with a different HapticClip assigned to each.
The duration of the assigned HapticClip in seconds.
Member Functions
void Play ( )
Starts playback of the HapticClip that has been assigned with the clip property from the start of the clip.
All properties applied to this HapticSource will be effective during playback.
Although multiple HapticSources can play simultaneously, the output of only one will be felt at any given moment on a given controller.
See HapticClipPlayer.priority for a description of how this works. For further information on Play() see HapticClipPlayer.Play(Controller).
For more details on playback states and playback behaviour, see HapticClipPlayer.
void Play
( Controller controller )
Starts playback of the HapticClip that has been assigned with the clip property on the controller passed by argument.
Serialization callback from the ISerializationCallbackReceiver interface. Unused for now but declared to fulfill the interface.
void OnAfterDeserialize ( )
Serialization callback from the ISerializationCallbackReceiver interface. HapticSource uses it to synchronize the properties of the wrapped HapticClipPlayer to the serializable fields on this HapticSource. This occurs whenever a user updates any of the values on the custom inspector or whenever Unity loads the persisted data.