extends AudioStreamPlayer

@export var take_damage_sfx : AudioStream

func _ready ():
	var unit = get_parent()
	
	unit.OnTakeDamage.connect(_play_take_damage_sfx)

func _play_take_damage_sfx (_health : int):
	_play_sound(take_damage_sfx)

func _play_sound (audio : AudioStream):
	stream = audio
	play()
