Click or drag to resize

AudioSourceExtensionsPlayOneShot Method

Plays the currently set AudioClip

Namespace:  ImmerseSDK.Extensions
Assembly:  ImmerseSDK.App (in ImmerseSDK.App.dll) Version: 3.9.0.0 (3.9.0.0)
Syntax
C#
public static bool PlayOneShot(
	this UnityEngine.AudioSource audioSource
)

Parameters

audioSource
Type: UnityEngine.AudioSource
Target AudioSource

Return Value

Type: Boolean
Returns true if the AudioSource and AudioClip exist

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type UnityEngine.AudioSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also