godot-start/zfoo/util/NodeUtils.gd

13 lines
201 B
GDScript
Raw Normal View History

2021-10-03 14:43:19 +00:00
extends Object
static func removeNode(node: Node) -> void:
if (node == null):
return
var parent = node.get_parent()
if (parent == null):
return
parent.remove_child(node)
node.queue_free()