LevelHolder.gd 312 B

1234567891011121314151617
  1. extends Node3D
  2. var current_level
  3. var current_level_scene
  4. var level_scene_instance
  5. func _ready() -> void:
  6. set_process(true)
  7. func load_level(level):
  8. current_level = level
  9. current_level_scene = load(current_level)
  10. level_scene_instance = current_level_scene.instantiate()
  11. add_child(level_scene_instance)