Attached Macromigueldeicaza.swiftgodot 0.45.0SwiftGodot
Godot(_:)
Creates the definition for a Swift class to be surfaced to Godot.
MacroDefs.swift:22@attached(member, names: named(_initializeClass), named(classInitializer), named(implementedOverrides)) macro Godot(_ behavior: ClassBehavior = .gameplay)
Parameters
- behavior
using
.tool
value makes the overridden methods like_ready
or_process
run in editor, making the class work like@tool
annotated script in GDScript
This macro creates the required constructors that the SwiftGodot framework requires (the init
, and the init(nativeHandle:)
) , ensures that both of those initialize the class if required, and registers any @Export
and @Callable
methods for the class effectively surfacing properties and methods to godot