Skip to content

UI 音效 API

UI 脚本使用全局对象 sound

js
sound.play("ui/confirm", 1.0, 1.0, false)

方法

  • sound.play(id, volume?, pitch?, loop?)
  • sound.playAt(id, x, y, z, volume?, pitch?, loop?)
  • sound.stop(id)

规则

  • id 必须是 sound/ 下相对路径
  • 不允许 behemiron:sound/ 前缀

示例

js
sound.play("ui/quest_accept")

sound.playAt("ambient/forest/day", 0, 70, 0, 0.8, 1.0, true)