mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Support native nodes to set parent to null (#9066)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user