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

A member named '_Ready' with the same parameter type has already been defined #44

Closed Lsy-291 closed 2 years ago

Lsy-291 commented 2 years ago

Hello, I encountered the following problems when using the godotonready you wrote. A member with the same parameter type named "_Ready" has been defined. This problem is related to the troubleshooting you listed, but I did not understand how to change my code. Could you please tell me in detail, thank you

Here is my code public override void _Ready()

Lsy-291 commented 2 years ago

Elsewhere, someone helped me point out the problem. Now it has been solved. You just need to change it to the following code [OnReady] public void YourFuncName() And finally, thanks to the author!

31 commented 2 years ago

Ah, thanks for letting me know about this part being unclear--I should definitely add a direct example fix there.

31 commented 2 years ago

Simplified that section a bit and added an example. (I tend to use [OnReady] private void Ready() when I'm swapping over existing scripts that do random stuff in _Ready and I'm not feeling creative about the name.)

Thanks again. 🙂