You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
698 B
GDScript
19 lines
698 B
GDScript
|
1 year ago
|
extends Node3D
|
||
|
|
class_name Level
|
||
|
|
|
||
|
|
var level_instance_list: Array[LevelInstance]
|
||
|
|
|
||
|
|
|
||
|
|
func GetLevelInstanceList() -> Array[LevelInstance]:
|
||
|
|
if not level_instance_list:
|
||
|
|
level_instance_list = []
|
||
|
|
var rooms_node: Node = %Levels as Node
|
||
|
|
for rooms_node_child in rooms_node.get_children():
|
||
|
|
if not rooms_node_child is LevelArea:
|
||
|
|
continue
|
||
|
|
for rooms_node_child_child in rooms_node_child.get_children():
|
||
|
|
if rooms_node_child_child is LevelInstance:
|
||
|
|
rooms_node_child_child.level_area_cfg = rooms_node_child.cfg
|
||
|
|
level_instance_list.append(rooms_node_child_child)
|
||
|
|
return level_instance_list
|