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

Feature Request: Add support for properties #22

Closed BigBoot closed 3 years ago

BigBoot commented 3 years ago

Would be useful for example for AnimationTree, something like this:

[OnReadyGet("AnimationTree", Property = "parameters/playback")]
private AnimationNodeStateMachinePlayback _playback;

Please tell me what you think, if you wan't I can also have a go at implementing this and submitting a PR.

31 commented 3 years ago

Nice idea, I like it a lot! I definitely have _playback = (AnimationNodeStateMachinePlayback)_animator.Get("parameters/playback"); in a few ready methods, myself. 😄

A couple implementation details that jump to mind:

I would definitely be interested in taking a PR. 🙂 If that doesn't work out, I'll take a look at it next time I run into a place this would be useful for me.