Class SimpleAudioFeedback
Component that responds to select and hover events by playing audio clips.
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.Feedback
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Feedback/Simple Audio Feedback", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.1/api/UnityEngine.XR.Interaction.Toolkit.Feedback.SimpleAudioFeedback.html")]
public class SimpleAudioFeedback : MonoBehaviour
Properties
allowHoverAudioWhileSelecting
Whether to allow hover audio to play while the interactor is selecting an interactable.
Declaration
public bool allowHoverAudioWhileSelecting { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
audioSource
The Audio Source component to use to play audio clips.
Declaration
public AudioSource audioSource { get; set; }
Property Value
Type | Description |
---|---|
Audio |
See Also
hoverCanceledClip
The audio clip to play when the interactor stops hovering over an interactable due to being canceled.
Declaration
public AudioClip hoverCanceledClip { get; set; }
Property Value
Type | Description |
---|---|
Audio |
See Also
hoverEnteredClip
The audio clip to play when the interactor starts hovering over an interactable.
Declaration
public AudioClip hoverEnteredClip { get; set; }
Property Value
Type | Description |
---|---|
Audio |
See Also
hoverExitedClip
The audio clip to play when the interactor stops hovering over an interactable without being canceled.
Declaration
public AudioClip hoverExitedClip { get; set; }
Property Value
Type | Description |
---|---|
Audio |
See Also
playHoverCanceled
Whether to play a sound when the interactor stops hovering over an interactable due to being canceled.
Declaration
public bool playHoverCanceled { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
playHoverEntered
Whether to play a sound when the interactor starts hovering over an interactable.
Declaration
public bool playHoverEntered { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
playHoverExited
Whether to play a sound when the interactor stops hovering over an interactable without being canceled.
Declaration
public bool playHoverExited { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
playSelectCanceled
Whether to play a sound when the interactor stops selecting an interactable due to being canceled.
Declaration
public bool playSelectCanceled { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
playSelectEntered
Whether to play a sound when the interactor starts selecting an interactable.
Declaration
public bool playSelectEntered { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
playSelectExited
Whether to play a sound when the interactor stops selecting an interactable without being canceled.
Declaration
public bool playSelectExited { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
selectCanceledClip
The audio clip to play when the interactor stops selecting an interactable due to being canceled.
Declaration
public AudioClip selectCanceledClip { get; set; }
Property Value
Type | Description |
---|---|
Audio |
See Also
selectEnteredClip
The audio clip to play when the interactor starts selecting an interactable.
Declaration
public AudioClip selectEnteredClip { get; set; }
Property Value
Type | Description |
---|---|
Audio |
See Also
selectExitedClip
The audio clip to play when the interactor stops selecting an interactable without being canceled.
Declaration
public AudioClip selectExitedClip { get; set; }
Property Value
Type | Description |
---|---|
Audio |
See Also
Methods
Awake()
See Mono
Declaration
protected void Awake()
See Also
GetInteractorSource()
Gets the interactor this behavior should subscribe to for events.
Declaration
public IXRInteractor GetInteractorSource()
Returns
Type | Description |
---|---|
IXRInteractor | Returns the interactor this behavior should subscribe to for events. |
See Also
OnDisable()
See Mono
Declaration
protected void OnDisable()
See Also
OnEnable()
See Mono
Declaration
protected void OnEnable()
See Also
PlayAudio(AudioClip)
Play the given audio clip.
Declaration
protected void PlayAudio(AudioClip clip)
Parameters
Type | Name | Description |
---|---|---|
Audio |
clip | The audio clip to play. |
See Also
Reset()
See Mono
Declaration
[Conditional("UNITY_EDITOR")]
protected void Reset()
See Also
SetInteractorSource(IXRInteractor)
Sets the interactor this behavior should subscribe to for events.
Declaration
public void SetInteractorSource(IXRInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The interactor this behavior should subscribe to for events. |
Remarks
This also sets the serialized field to the given interactor as a Unity Object.