PlayAudioAction is a primitive that supports playback of sound effects. To set up the PlayAudioAction primitive, ensure that the audio you want to play is an AudioSource attached to a child of the Avatar. The audioSourceName variable should be set to the name of the child object.
More...
List of all members.
Public Member Functions |
override ActionResult | Start (Core.Agent agent, float deltaTime) |
| ActionResult.Start Searches the Avatar hierarchy for the AudioSource attached to the GameObject named audioSourceName.
|
override ActionResult | Execute (Core.Agent agent, float deltaTime) |
| ActionResult.Execute Begin playback of audio if not already playing.
|
override ActionResult | Stop (Core.Agent agent, float deltaTime) |
| ActionResult.Stop If the current audio is looping, stops audio playback. If audio is not looping, Stop will not stop it.
|
Public Attributes |
string | audioSourceName |
| The name of the GameObject containing the AudioSource you want to play. The GameObject must be a child of the Avatar.
|
AudioSource | audioSource |
| The audioSource to play. If this is not set before Start is called it will be found based on the audioSourceName.
|
bool | waitUntilDone = false |
| waitUntilDone specifies whether the action should return RUNNING until the audio completes playback.
|
float | delay = 0f |
| delay specifies how long to wait before beginning audio playback. This may be used to sync audio with other actions, such as animations, that may be triggered after the audio playback.
|
Detailed Description
PlayAudioAction is a primitive that supports playback of sound effects. To set up the PlayAudioAction primitive, ensure that the audio you want to play is an AudioSource attached to a child of the Avatar. The audioSourceName variable should be set to the name of the child object.
Member Function Documentation
ActionResult.Execute Begin playback of audio if not already playing.
- Parameters:
-
- Returns:
- RUNNING if the audio is looping or if waitUntilDone is true and audio is still playing. FAILURE if no audio source is set. SUCCESS otherwise
ActionResult.Start Searches the Avatar hierarchy for the AudioSource attached to the GameObject named audioSourceName.
- Parameters:
-
- Returns:
- SUCCESS
ActionResult.Stop If the current audio is looping, stops audio playback. If audio is not looping, Stop will not stop it.
- Parameters:
-
- Returns:
- SUCCESS
Member Data Documentation
The audioSource to play. If this is not set before Start is called it will be found based on the audioSourceName.
The name of the GameObject containing the AudioSource you want to play. The GameObject must be a child of the Avatar.
delay specifies how long to wait before beginning audio playback. This may be used to sync audio with other actions, such as animations, that may be triggered after the audio playback.
waitUntilDone specifies whether the action should return RUNNING until the audio completes playback.