GD0107:不是从 Node 派生的类型不应导出 Node 成员
规则 ID |
GD0107 |
类别 |
用法 |
修复是破坏性的还是非破坏性的 |
破坏性的 |
默认启用 |
是 |
原因
A type that doesn't derive from Node
contains an exported field or property
of a type that derives from Node
.
规则说明
Exported nodes are serialized as NodePath
. Only types derived from Node
are able to get the node instance from the NodePath
.
如何解决违规情况
To fix a violation of this rule, avoid exporting Node
members on a type that
doesn't derive from Node
, or consider exporting a NodePath
.
何时抑制警告
请勿禁止该规则的警告。未继承自 Node
的类型无法获取导出 Node
成员的正确实例,这会导致预料之外的运行时错误。