Skip to content

format

typescript
AudioSource.playOnAwake

class: AudioSource

description

Whether to automatically play audio when the game object is awakened.

If the audio source automatically plays audio when the game object is awakened, it is true; otherwise, it is false.

parameter

param_nametypedescription

reture

typedescription
booleanWhether to play on awake

code example

typescript
let obj = new GameObject();
let source = obj.AddComponent<AudioSource>(AudioSource);
source.playOnAwake;