Files
fps_project_1/scripts/playlist_loader.gd

22 lines
676 B
GDScript

extends Node
@onready var playlist_generator: Control = $"../Playlist Generator"
var round_id = 2
var portals = []
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
playlist_generator.load_playlist()
print("CURRENT MATCH : ",GameGlobals.current_match)
for i in get_tree().current_scene.get_children():
if i.is_in_group("portal"):
portals.append(i)
var id = 0
for i in portals:
i.scene_path = str(GameGlobals.current_match[round_id][id]["level_path"])
i.scene_name = str(GameGlobals.current_match[round_id][id]["level_name"])
i.level_gamemode = load(GameGlobals.current_match[round_id][id]["gamemode_path"])
id += 1