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...
GD0101: The exported member is static¶
规则 ID |
GD0101 |
类别 |
用法 |
修复是中断修复还是非中断修复 |
Breaking - If the Non-breaking - If the |
默认启用 |
是 |
原因¶
A static member is annotated with the [Export] attribute. Static members
can't be exported.
规则说明¶
Godot doesn't allow exporting static members.
// Static members can't be exported.
[Export]
public static int InvalidProperty { get; set; }
// Instance members can be exported.
[Export]
public int ValidProperty { get; set; }
如何解决冲突¶
To fix a violation of this rule, remove the [Export] attribute or remove the
static keyword.
何时禁止显示警告¶
Do not suppress a warning from this rule. Static members can't be exported so they will be ignored by Godot, resulting in runtime errors.