migueldeicaza / SwiftGodot

New Godot bindings for Swift
https://migueldeicaza.github.io/SwiftGodotDocs/tutorials/swiftgodot-tutorials/
MIT License
1.19k stars 77 forks source link

Adds specifying a path to @BindNode #481

Closed lorenalexm closed 6 months ago

lorenalexm commented 6 months ago

Previously the @BindNode property wrapper would only fetch a node based on its property name. Leaving a mix of camel and pascal cased properties in the class. Basing the wrapper entirely on the property name also posed an issue if your node was nested within the tree. These changes allow one to use the property wrapper @BindNode(withPath:) to either specify a nested path, or to decouple the naming of the property and the node within Godot. As the initializer parameter is optional, this is a nonbreaking change.

migueldeicaza commented 6 months ago

Thank you for your contribution.