xiandie/manager/audio_manager/embellishment.gd
2025-06-18 21:48:59 +08:00

26 lines
919 B
GDScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@tool
class_name Embellishment
extends Resource
## Embellishment.gd
## 定义一个“点缀音”的数据结构。
## 作为一个可复用的资源,你可以在文件系统中创建多个点缀音配置,
## 比如 "cricket_sound.tres", "wind_gust.tres" 等。
# 点缀音的音源文件wav, ogg, mp3等
@export var sound: AudioStream
# 播放此点缀音时,相对于 VibeGroup 整体音量的分贝dB调整值。
# 0 表示不变, 负数表示减小音量, 正数表示增大音量。
@export_range(-60, 6, 0.1, "dB") var db: float = 0.0
# 播放此点缀音的最小随机间隔时间(秒)。
@export_range(0.1, 300.0, 0.1, "s") var min_interval: float = 5.0
# 播放此点缀音的最大随机间隔时间(秒)。
@export_range(0.1, 300.0, 0.1, "s") var max_interval: float = 10.0
func _init():
# 确保 min <= max
if min_interval > max_interval:
max_interval = min_interval