Loads of crap
This commit is contained in:
parent
b5bf7619e6
commit
1dc768ad27
725 changed files with 15096 additions and 191 deletions
27
Utilities/Debug/DebugHelper.gd
Normal file
27
Utilities/Debug/DebugHelper.gd
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
class_name DebugHelperClass
|
||||
extends Node
|
||||
|
||||
func _count_nodes_recursive(node: Node) -> int:
|
||||
var count = 1 # Count current node
|
||||
for child in node.get_children():
|
||||
count += _count_nodes_recursive(child)
|
||||
|
||||
return count
|
||||
|
||||
func _count_nodes_by_type(node: Node, type_name: String) -> int:
|
||||
var count = 0
|
||||
if node.get_script() and node.get_script().get_global_name() == type_name:
|
||||
count += 1
|
||||
|
||||
for child in node.get_children():
|
||||
count += _count_nodes_by_type(child, type_name)
|
||||
return count
|
||||
|
||||
func _count_nodes_by_name_pattern(node: Node, pattern: String) -> int:
|
||||
var count = 0
|
||||
if node.name.contains(pattern):
|
||||
count += 1
|
||||
|
||||
for child in node.get_children():
|
||||
count += _count_nodes_by_name_pattern(child, pattern)
|
||||
return count
|
||||
1
Utilities/Debug/DebugHelper.gd.uid
Normal file
1
Utilities/Debug/DebugHelper.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cd4o4df64qlb7
|
||||
Loading…
Add table
Add a link
Reference in a new issue