Global Sounds system

This commit is contained in:
Haze Weathers 2025-03-08 16:32:47 -05:00
parent 5677971bf0
commit ba3306c04c
15 changed files with 232 additions and 1 deletions

View file

@ -0,0 +1,18 @@
@tool
extends Node
@export_tool_button("Update Sounds") var _update_sounds_action = _update_sounds
@export var sounds: Dictionary[StringName, AudioStreamPlayer]
func play_sound(id: StringName) -> void:
var sound := sounds.get(id) as AudioStreamPlayer
sound.play()
func _update_sounds() -> void:
sounds.clear()
for node in get_children():
if node is AudioStreamPlayer:
sounds[node.name] = node
notify_property_list_changed()