I am updating my project to the latest version of SwiftGodot, and have run in to this issue.
In my project, I have some custom resources which simply exports some value:
@Godot
class IntResource: Resource {
public var hasChanged = false
public var innerValue: Int = 0
@Export
public var value: Int {
get {
if hasChanged {
return innerValue
}
return defaultValue
}
}
@Export
public var defaultValue: Int = 0
}
This is no longer possible, as the code generation for this export redefined 'value' to be a let:
func _mproxy_set_value (args: [Variant]) -> Variant? {
guard let arg = args.first else {
return nil
}
if let value = Int (arg) {
value = value
} else {
GD.printErr ("Unable to set `value` value: ", arg)
}
return nil
}
I am updating my project to the latest version of SwiftGodot, and have run in to this issue.
In my project, I have some custom resources which simply exports some value:
This is no longer possible, as the code generation for this export redefined 'value' to be a
let
: