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 Default_Map = "res://Assets/Levels/test_map.tscn"
|
||||||
var Test_Map = "res://Assets/Levels/TestMapHospitalTextures.tscn"
|
var Test_Map = "res://Assets/Levels/TestMapHospitalTextures.tscn"
|
||||||
|
|
||||||
func openMap():
|
var current_map
|
||||||
print(GlobalSettings.current_map)
|
|
||||||
var map_instance = load(GlobalSettings.current_map).instantiate()
|
func openMap(path=GlobalSettings.current_map):
|
||||||
add_child(map_instance)
|
current_map = load(path).instantiate()
|
||||||
|
add_child(current_map)
|
||||||
|
|
||||||
|
|
||||||
|
func closeMap():
|
||||||
|
remove_child(current_map)
|
||||||
|
|
||||||
func _init():
|
func _init():
|
||||||
openMap()
|
openMap()
|
||||||
|
|||||||
Reference in New Issue
Block a user