Support native nodes to set parent to null (#9066)

This commit is contained in:
GengineJS
2021-07-26 11:19:35 +08:00
committed by GitHub
parent 0e0502117d
commit aa7ff8af0b
+1 -1
View File
@@ -529,7 +529,7 @@ export class Node extends BaseNode implements CustomSerializable {
if (keepWorldTransform) { this.updateWorldTransform(); }
super.setParent(value, keepWorldTransform);
if (JSB) {
this._nativeObj!.setParent(this.parent?.native);
this._nativeObj!.setParent(this.parent ? this.parent.native : null);
}
}