mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 02:02:41 +08:00
new instantiated nodes should clean it's fileId before adding to other prefabs. (#2753)
This commit is contained in:
@@ -1107,8 +1107,11 @@ var BaseNode = cc.Class({
|
||||
var myPrefabInfo = this._prefab;
|
||||
if (myPrefabInfo) {
|
||||
if (newPrefabRoot) {
|
||||
// change prefab
|
||||
_Scene.PrefabUtils.linkPrefab(newPrefabRoot._prefab.asset, newPrefabRoot, this);
|
||||
if (myPrefabInfo.root !== newPrefabRoot) {
|
||||
// change prefab
|
||||
_Scene.PrefabUtils.unlinkPrefab(this);
|
||||
_Scene.PrefabUtils.linkPrefab(newPrefabRoot._prefab.asset, newPrefabRoot, this);
|
||||
}
|
||||
}
|
||||
else if (myPrefabInfo.root !== this) {
|
||||
// detach from prefab
|
||||
|
||||
Reference in New Issue
Block a user