Loads of crap

This commit is contained in:
Dan Baker 2025-06-26 14:46:23 +01:00
parent b5bf7619e6
commit 1dc768ad27
725 changed files with 15096 additions and 191 deletions

View 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