ja
This commit is contained in:
12
scripts/sound_effect.gd
Normal file
12
scripts/sound_effect.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends AudioStreamPlayer
|
||||
class_name SoundEffect
|
||||
|
||||
@export var audio_library: Array[SoundeffectResource]
|
||||
|
||||
func play_key(key: String) -> void:
|
||||
for res in audio_library:
|
||||
if res.key == key:
|
||||
stream = res.audio
|
||||
play()
|
||||
return
|
||||
push_error(key + " is not available in the Audio Library variable")
|
Reference in New Issue
Block a user