From 7c34297bc676b37dbb7b0a53c2d334aa2a1bfcdf Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Wed, 20 Mar 2024 18:27:05 -0400 Subject: [PATCH] Document a case from Slack --- Sources/SwiftGodot/SwiftGodot.docc/Exports.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sources/SwiftGodot/SwiftGodot.docc/Exports.md b/Sources/SwiftGodot/SwiftGodot.docc/Exports.md index 1b536832a..c8eef881b 100644 --- a/Sources/SwiftGodot/SwiftGodot.docc/Exports.md +++ b/Sources/SwiftGodot/SwiftGodot.docc/Exports.md @@ -246,6 +246,17 @@ public override func _ready() } ``` +If you find yourself that you do not want to provide manual get/set properties +in your export, and want to have an optional for one of the Object types, you +can use something like this: + +```swift +@Export(.nodeType, "Camera3D") +var camera: Camera3D? = nil +``` + +The parameter to `.nodeType` needs to match the type of the object. + ### Resources ```