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...
GD0107: 未继承自 Node 的类型不应导出 Node 成员¶
规则 ID |
GD0107 |
类别 |
用法 |
修复是中断修复还是非中断修复 |
中断 |
默认启用 |
是 |
原因¶
一个并未继承自 Node 的类型内包含了一个导出字段或属性,其类型继承自 Node。
规则说明¶
导出的节点将会被序列化为 NodePath。只有继承自 Node 的类型才能通过 NodePath 获取类型实例。
如何解决冲突¶
欲解决该规则带来的冲突,请避免在并未继承自 Node 的类型中导出 Node 成员,或考虑导出 NodePath。
何时禁止显示警告¶
请勿禁止该规则的警告。未继承自 Node 的类型无法获取导出 Node 成员的正确实例,这会导致预料之外的运行时错误。