Update check_children() and check_orphan_nodes()
I made them no longer be a single line. check_children() now prints all children of /root too.
This commit is contained in:
parent
a58bfb23dc
commit
7b9c84b805
1 changed files with 9 additions and 2 deletions
|
@ -166,6 +166,13 @@ func terminate(exit_code: int = 0) -> void:
|
|||
get_tree().quit(exit_code)
|
||||
|
||||
# Checks
|
||||
func check_children() -> void: if get_tree().root.get_child_count() != 1: lwarn("There are still '" + str(get_tree().root.get_child_count()-1) + "' children active in the scene tree. Please make sure to call 'remove_child' on them in your tests.")
|
||||
func check_children() -> void:
|
||||
if get_tree().root.get_child_count() != 1:
|
||||
lwarn("There are still '" + str(get_tree().root.get_child_count()-1) + "' children active in the scene tree. Please make sure to call 'remove_child' on them in your tests.")
|
||||
lwarn("Here's a tree of /root:")
|
||||
get_tree().root.print_tree_pretty()
|
||||
|
||||
func check_orphan_nodes() -> void: if config_print_orphan_nodes: if Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT) != 4: lwarn("There are still '" + str(Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT)-4) + "' orphan nodes loaded. Please make sure to call 'queue_free' or 'free' on them in your tests.")
|
||||
func check_orphan_nodes() -> void:
|
||||
if config_print_orphan_nodes:
|
||||
if Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT) != 4:
|
||||
lwarn("There are still '" + str(Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT)-4) + "' orphan nodes loaded. Please make sure to call 'queue_free' or 'free' on them in your tests.")
|
||||
|
|
Loading…
Reference in a new issue