Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
C# 诊断¶
Godot 中包含了分析器,会检查 C# 源代码是否有非法或不支持的代码,并向你告知在构建时出现了错误。
Rules¶
- GD0001: Missing partial modifier on declaration of type that derives from GodotObject
- GD0002: Missing partial modifier on declaration of type which contains nested classes that derive from GodotObject
- GD0101: Attempted to export static member
- GD0102: The type of the exported member is not supported
- GD0103: The exported member is read-only
- GD0104: The exported property is write-only
- GD0105: Attempted to export indexer property
- GD0106: Attempted to export explicit interface property implementation
- GD0107: 未继承自 Node 的类型不应导出 Node 成员
- GD0201: The name of the delegate must end with 'EventHandler'
- GD0202: The parameter of the delegate signature of the signal is not supported
- GD0203: The delegate signature of the signal must return void
- GD0301: The generic type argument must be a Variant compatible type
- GD0302: The generic type parameter must be annotated with the MustBeVariant attribute
- GD0303: Symbol parent of a type argument that must be Variant compatible was not handled
- GD0401: The class must derive from GodotObject or a derived class
- GD0402: The class must not contain generic arguments