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:从 GodotObject 派生的类型声明中缺少 partial 修饰符
- GD0002:包含从 GodotObject 派生的嵌套类的类型声明中缺少 partial 修饰符
- GD0003:在同一个脚本文件中发现多个同名的类
- GD0101:导出成员是静态的
- GD0102:导出成员的类型不受支持
- GD0103:导出的成员是只读的
- GD0104:导出的属性是只写的
- GD0105:导出的属性是一个索引器
- GD0106:导出的属性是一个显式接口实现
- GD0107:不是从 Node 派生的类型不应导出 Node 成员
- GD0108: The exported tool button is not in a tool class
- GD0109: The '[ExportToolButton]' attribute cannot be used with another '[Export]' attribute
- GD0110: The exported tool button is not a Callable
- GD0111: The exported tool button must be an expression-bodied property
- GD0201:委托的名称必须以“EventHandler”结尾
- GD0202:信号的委托签名参数不受支持
- GD0203:信号的委托签名必须返回 void
- GD0301:泛型类型参数必须是 Variant 兼容类型
- GD0302:泛型类型参数必须用“[MustBeVariant]”属性注解
- GD0303:必须与变体兼容的类型参数的父符号未被处理
- GD0401:该类必须继承自 Godot.GodotObject 或其派生类
- GD0402:该类不能是泛型类