fabapp/godot/main.gd
2023-12-20 22:41:41 +01:00

17 lines
527 B
GDScript

extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
Global.state_changed.connect(_update_state)
if Global.current_state == Global.State.UNLOADED:
pass
elif Global.current_state == Global.State.LOADED:
$MarginContainer.remove_child($MarginContainer/Unloaded)
var s = ResourceLoader.load("res://loaded.tscn")
var current_scene = s.instantiate()
$MarginContainer.add_child(current_scene)
func _update_state(old: Global.State, new: Global.State):
print("updated state")