@tool
extends Node3D

@export_file("*.tscn") var target_scene_path := "res://scenes/Levels/transportation_level.tscn":
	set(value):
		target_scene_path = value
		_sync_teleporter()

@export var target_group: StringName = &"player":
	set(value):
		target_group = value
		_sync_teleporter()

@export var one_shot := true:
	set(value):
		one_shot = value
		_sync_teleporter()

@onready var teleporter: Area3D = $Teleporter


func _ready() -> void:
	_sync_teleporter()


func _sync_teleporter() -> void:
	if teleporter == null:
		return
	teleporter.set("target_scene_path", target_scene_path)
	teleporter.set("target_group", target_group)
	teleporter.set("one_shot", one_shot)
