Changed Level loading to allow me to call openMap with a path to a specific map but by default will use the global setting map and added closeMap function

This commit is contained in:
Willow Behar
2024-05-10 11:24:46 -05:00
parent ed75e84ece
commit cbb3760380

View File

@ -3,10 +3,15 @@ extends Node3D
var Default_Map = "res://Assets/Levels/test_map.tscn"
var Test_Map = "res://Assets/Levels/TestMapHospitalTextures.tscn"
func openMap():
print(GlobalSettings.current_map)
var map_instance = load(GlobalSettings.current_map).instantiate()
add_child(map_instance)
var current_map
func openMap(path=GlobalSettings.current_map):
current_map = load(path).instantiate()
add_child(current_map)
func closeMap():
remove_child(current_map)
func _init():
openMap()