extends Control

var to_be_loaded : String

func _ready() -> void:
	to_be_loaded = Global.scene_to_load
	ResourceLoader.load_threaded_request(to_be_loaded) # start laden


func _process(_delta: float) -> void:
	var status = ResourceLoader.load_threaded_get_status(to_be_loaded)
	
	if status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_LOADED:
		var scene = ResourceLoader.load_threaded_get(to_be_loaded)
		get_tree().change_scene_to_packed(scene)
