Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
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
- GD0003: Found multiple classes with the same name in the same script file
- GD0101: The exported member is static
- 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: The exported property is an indexer
- GD0106: The exported property is an explicit interface 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: The parent symbol of a type argument that must be Variant compatible was not handled
- GD0401: The class must derive from Godot.GodotObject or a derived class
- GD0402: The class must not be generic