SoundEntity¶
Beta
SoundEntity
Play the configured audio clip,and play the local configuration firstFunctions¶
Play 2d sound,no playback distance limit
soundName
The name of the sound you want to playisLoop
whether to loopdelayTime
delay play time
YaSoundHandle Play3DSound(string soundName, float3 position, quaternion rotation, [boolean isLoop], [number delayTime])Beta
Play 3d sound at position
soundName
The name of the sound you want to playposition
world positionrotation
world rotationisLoop
whether to loopdelayTime
delay play time
YaSoundHandle Play3DSound(string soundName, float3 position, [float3 eulerAngle], [boolean isLoop], [number delayTime])Beta
Play 3d sound at position
soundName
The name of the sound you want to playposition
world positioneulerAngle
world euler angleisLoop
whether to loopdelayTime
delay play time
YaSoundHandle Play3DSound(string soundName, YaEntity followTarget, [number bonePoint], [boolean isLoop], [number delayTime])Beta
Play 3d sound follow target
soundName
The name of the sound you want to playfollowTarget
target entity you want to followbonePoint
which way to follow the goal.Default 0 is follow the root position.if target entity is an avatar,1 is follow the left hand,2 is follow the right hand,4 is follow the top of headisLoop
whether to loopdelayTime
delay play time
Play BGM,The new one will replace the old one
soundName
The name of the sound you want to playisLoop
whether to loopdelayTime
delay play time