extends Button class_name SoundButton @export var audio_collections: Array[AudioStreamCollection] = [ preload("res://config/audio/ui/ui_click.tres") ] func _ready(): if audio_collections: #print("sound button load audio_collections into audio_player") var audio_player := RandomAudioStreamPlayer.new() audio_player.audio_collections = audio_collections pressed.connect(audio_player.play_random) add_child(audio_player) else: printerr("sound button has no audio_collections! ignore initialization of audio_player")