GodotOnReady
GodotOnReady copied to clipboard
A C# Source Generator that adds convenient onready-like features to your C# scripts in Godot Mono (3.x) without any reflection.
I haven't found a way to get references working yet, so I've just copied the attributes file over to the code generator csproj. Here's the extension method I use to...
On 2021/01/14, the cookbook got some instructions on how to unit test: https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.cookbook.md#unit-testing-of-generators https://github.com/dotnet/roslyn/issues/44075 That would definitely be better than what I do now. (Open a project and build, then...
The generator currently makes something like this: ```cs [OnReadyGet("Face")] private Spatial _face; ... if (FacePath != null) { _face = GetNode(FacePath); } if (_face == null) { throw new NullReferenceException($"'{((Resource)GetScript()).ResourcePath}'...
I believe Godot 4.0 now lets you `[Export] public Node n;`. Providing `[OnReadyGet] public Node n;` is the main reason I wrote this library, so I'm thinking it might now...