gd: added input addon

This commit is contained in:
2025-05-27 19:20:46 +02:00
parent d8a1604af9
commit c8d8c7ec25
683 changed files with 21608 additions and 2 deletions

View File

@ -0,0 +1,22 @@
## Removes and frees all children of a node.
static func clear(node:Node):
if not is_instance_valid(node):
return
for child in node.get_children():
node.remove_child(child)
child.queue_free()
## Checks if the given resource is an inline resource. If so, returns a shallow copy,
## otherwise returns the resource. If the resource is null, returns null.
static func duplicate_if_inline(resource:Resource) -> Resource:
if is_inline(resource):
return resource.duplicate()
return resource
## Checks if the given resource is an inline resource.
static func is_inline(resource:Resource) -> bool:
if resource == null:
return false
return resource.resource_path.contains("::") or resource.resource_path == ""