@tool
extends Area2D
## This tool script makes sure that all doors have a spawn point assigned.

func _ready() -> void:
	if Engine.is_editor_hint():
		return

func _get_configuration_warnings() -> PackedStringArray:
	if not Engine.is_editor_hint():
		return []
	
	var warnings : PackedStringArray = []
	
	for shape : Node in get_children():
		if not is_instance_of(shape, CollisionShape2D):
			continue
		if not shape.get_node_or_null("InDirection"):
			warnings.append("CollisionShape2D [" + shape.name + "] does not contain a Child of type [Marker2D] named \"InDirection\".")
	
	return warnings
