AudioControllerPlay Method (String, Transform)
|
Plays an audio item with the name audioID parented to a specified transform.
Namespace:
(Default Namespace)
Assembly:
AudioToolkit (in AudioToolkit.dll) Version: 8.2.0.0 (8.2.0.0)
Syntax public static AudioObject Play(
string audioID,
Transform parentObj
)
Parameters
- audioID
- Type: SystemString
The audio ID. - parentObj
- Type: Transform
The parent transform.
Return Value
Type:
AudioObject
Returns the reference of the AudioObject that is used to play the audio item, or
null if the audioID does not exist.
Remarks
If the audio clip is marked as 3D the audio clip will be played at the position of the parent transform.
As the audio object will get attached to the transform, it is important to destroy the parent object using the
Destroy(GameObject) function, even if the parent object is not poolable itself
See Also