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:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user