small test

This commit is contained in:
pietru 2025-05-16 19:30:37 +02:00
parent e94f3ef4d5
commit c55c1d3563
2 changed files with 25 additions and 0 deletions

4
scripts/hello.gd.txt Normal file
View file

@ -0,0 +1,4 @@
extends Node
func _ready():
print("Hello world with no .UID files!")

21
test.tscn Normal file
View file

@ -0,0 +1,21 @@
[gd_scene load_steps=2 format=3 uid="uid://b71653f53iyqe"]
[sub_resource type="GDScript" id="GDScript_unn25"]
script/source = "extends Node
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var scripts_dir = \"res://scripts/\"
for file in DirAccess.get_files_at(scripts_dir):
if file.ends_with(\".gd.txt\"):
var node = Node.new()
var script = GDScript.new()
script.source_code=FileAccess.get_file_as_string(scripts_dir+file)
script.reload()
node.set_script(script)
add_child(node)
"
[node name="Node" type="Node"]
script = SubResource("GDScript_unn25")