31 / GodotOnReady

A C# Source Generator that adds convenient onready-like features to your C# scripts in Godot Mono (3.x) without any reflection.
https://www.nuget.org/packages/GodotOnReady
MIT License
123 stars 13 forks source link

Consolidate to one attribute that applies to Nodes and Resources #5

Closed 31 closed 3 years ago

31 commented 3 years ago

Right now [OnReadyPath] generates GetNode, [OnReadyLoad] generates GD.Load.

Instead, there could be just one attribute that calls the right function depending on the type of the annotated field/property. If a subclass of Node, GetNode, if a subclass of Resource, GD.Load.

[OnReadyGet]?

This makes is more obvious how to combine these code paths, and could make it easier to implement some shared features like Private.

This could also combine with [OnReady], however none of the properties of [OnReadyPath] apply to methods so this makes less sense.