Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func get_all_nodes(root: Node,Filter : bool = false,NodeClass = Node,list = []):
- var _Class
- if NodeClass:
- _Class = NodeClass.new()
- if not Filter:
- for node in root.get_children():
- list.append(node)
- get_all_nodes(node,false,null,list)
- return list
- else:
- for node in root.get_children():
- if node.get_class() == _Class.get_class():
- list.append(node)
- get_all_nodes(node,true,NodeClass,list)
- return list
Add Comment
Please, Sign In to add comment