Skip to content

SoundEntity

Beta
SoundEntity Play the configured audio clip,and play the local configuration first

Functions

YaSoundHandle PlaySound(string soundName, [boolean isLoop], [number delayTime])Beta
Play 2d sound,no playback distance limit
  • soundName The name of the sound you want to play
  • isLoop whether to loop
  • delayTime 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 play
  • position world position
  • rotation world rotation
  • isLoop whether to loop
  • delayTime 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 play
  • position world position
  • eulerAngle world euler angle
  • isLoop whether to loop
  • delayTime 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 play
  • followTarget target entity you want to follow
  • bonePoint 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 head
  • isLoop whether to loop
  • delayTime delay play time
YaSoundHandle PlayBGM(string soundName, [boolean isLoop], [number delayTime])Beta
Play BGM,The new one will replace the old one
  • soundName The name of the sound you want to play
  • isLoop whether to loop
  • delayTime delay play time