16 lines
442 B
GDScript
16 lines
442 B
GDScript
extends SceneTree
|
|
func _init() -> void:
|
|
var scene = preload("res://scenes/player.tscn").instantiate()
|
|
var masbro = scene.get_node("Masbro")
|
|
if masbro:
|
|
print("Masbro found! Children:")
|
|
_print_tree(masbro, 0)
|
|
else:
|
|
print("No Masbro")
|
|
quit()
|
|
func _print_tree(n: Node, depth: int) -> void:
|
|
var indent = " ".repeat(depth)
|
|
print("%s- %s (%s)" % [indent, n.name, n.get_class()])
|
|
for c in n.get_children():
|
|
_print_tree(c, depth + 1)
|