extends Control
func _enter_tree():
SceneLoader._scene_loading.connect(_on_scene_loading.bind())
SceneLoader._loaded_scene.connect(_on_loaded_scene.bind())
SceneLoader._scene_load_error.connect(_on_scene_load_error.bind())
func _process(delta):
SceneLoader.process(delta)
func _exit_tree():
SceneLoader._scene_loading.disconnect(_on_scene_loading.bind())
SceneLoader._loaded_scene.disconnect(_on_loaded_scene.bind())
SceneLoader._scene_load_error.disconnect(_on_scene_load_error.bind())
func _on_scene_loading(p):
$Label.text = "Loading... %d" % [int(p * 100)]
func _on_loaded_scene(scene):
get_tree().change_scene_to_packed(scene)
func _on_scene_load_error(error_type):
print ('error:' + str(error_type))