Consistent SYSTEMS
This commit is contained in:
16
scripts/Singleton/OverworldSystem.gd
Normal file
16
scripts/Singleton/OverworldSystem.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
class_name OverworldSystem extends Node
|
||||
|
||||
const MAPS:Dictionary[String, String] = {
|
||||
"TestMap": "res://scenes/Maps/TestMap/TestMap.tscn"
|
||||
};
|
||||
|
||||
var currentMap:String = "";
|
||||
|
||||
signal mapChanged(mapHandle:String, mapScene:String);
|
||||
|
||||
func setMap(map:String) -> void:
|
||||
assert(MAPS.has(map), "Map not found: " + map)
|
||||
if currentMap == map:
|
||||
return
|
||||
currentMap = map
|
||||
mapChanged.emit(map, MAPS[map])
|
Reference in New Issue
Block a user