extends Resource
class_name SFXSignalBinding

@export var target_node: NodePath
@export var signal_name: StringName

@export var audio_stream: AudioStream

## VFX 播放位置来源
enum SpawnSpace {
	##如果是跟随Target，不需要额外的参数
	GLOBAL,
	
	##如果是直接Spawn在World，需要提供一个额外的全局坐标
	WORLD_POSITION
}

@export var spawn_space := SpawnSpace.GLOBAL
@export var offset := Vector2.ZERO
@export var debug_print:= false 

## 音效参数
@export var volume_db: float = 0.0
@export var pitch_scale: float = 1.0
@export var autoplay: bool = true

func get_debug_message() -> String:
	var target_str = "UnknownTarget" if target_node.is_empty() else str(target_node)
	var signal_str = "UnknownSignal" if signal_name.is_empty() else str(signal_name)
	return "[SFX] Played triggered by signal \"%s\" on node \"%s\"" % [signal_str, target_str]
