Created
March 24, 2021 05:27
-
-
Save PranavSK/aa9517d6c3d1a95579f7406c827afa18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class_name NodeUtils | |
static func get_children_of_type(node: Node, type) -> Array: | |
var ret: = [] | |
for child in node.get_children(): | |
if child is type: | |
ret.append(child) | |
if child.get_child_count() > 0: | |
ret += get_children_of_type(child, type) | |
return ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment