Cat-Lips / GodotSharp.SourceGenerators

C# source generators for the Godot Game Engine
MIT License
127 stars 13 forks source link

Generation fails if the scene has a node with a built-in script #43

Closed jwright159 closed 10 months ago

jwright159 commented 10 months ago
The given key '' was not present in the dictionary.

External scripts are defined in the tscn with script = ExtResource("some_id"). Built-in scripts are defined with script = SubResource("some_id"). The scraper only checks for ExtResource, so SubResource fails the regex, and and the id is set to "". This isn't present in the resources dictionary.

I would recommend just ignoring build-in scripts, since by definition it doesn't have a C# class.

Cat-Lips commented 10 months ago

Thanks Jady. Good find. I'll create some tests and add your fix :)