extends Area3D

class_name InteractionReciever

signal interaction_start(source: InteractionSource)

func _ready() -> void:
	area_entered.connect(on_area_entered)
	area_exited.connect(on_area_exited)

func on_area_entered(area: Area3D):
	if area is InteractionSource:
		area.interaction_requested.connect(interaction_start.emit)

func on_area_exited(area: Area3D):
	if area is InteractionSource:
		area.interaction_requested.disconnect(interaction_start.emit)
