48. Inheritance, annotations and editor code
class Charge:
var amount: int = 10
func description() -> String:
return "Charge: " + str(amount)class FullCharge extends Charge:
func description() -> String:
return super.description() + " (ready)"func run() -> String:
return FullCharge.new().description()A subclass can override a parent method. super calls the parent implementation. Keep an override’s signature compatible with the inherited method; replacing a base helper with a different parameter list can cause parser errors.
Godot annotations include @export, @onready, @tool, @warning_ignore and @rpc. @export creates a Godot Inspector property for a file-backed scene script; it does not automatically add a field to PCA’s custom record inspector. @onready runs at Godot ready time, which is still before PCA binds a newly added record instance.
@tool runs in the Godot editor context. The standalone PCA application is itself a running Godot application, not automatically a Godot EditorPlugin host. Custom PCA designer tools require an actual integration, not merely an @tool line.
