virtualx-engine/modules/gdscript/tests/scripts/runtime/features/free_is_callable.gd
George Marques b4e08eb752
Allow free() to be used as Callable
This method is registered in a special way so ClassDB doesn't naturally
know about its existence. Here it is hardcoded if any other option fail
to check if it is about the `free()` method and, if so, say it exists
and return a Callable.
2024-01-18 09:33:44 -03:00

10 lines
178 B
GDScript

func test():
var node := Node.new()
var callable: Callable = node.free
callable.call()
print(node)
node = Node.new()
callable = node["free"]
callable.call()
print(node)