godot-steering-ai-framework/project/demos/DemoPlayer.gd

17 lines
254 B
GDScript3
Raw Normal View History

extends Node2D
func load_demo(scene_path: String) -> void:
if not scene_path:
return
var demo = load(scene_path)
if demo:
add_child(demo.instance())
func unload() -> void:
for node in get_children():
remove_child(node)
node.queue_free()