Skip to content

Commit

Permalink
修复bug。
Browse files Browse the repository at this point in the history
  • Loading branch information
tengge1 committed Aug 11, 2019
1 parent 055af26 commit 2503fb0
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions ShadowEditor.Web/src/serialization/core/ServerObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,26 @@ ServerObject.prototype.revertLayer = function (obj, list, children, parts) {
for (let i = 0; i < list.length; i++) {
let item = list[i];

let child = children.filter(n => n.uuid === item.uuid)[0];
const child1 = children.filter(n => n.uuid === item.uuid)[0];
const child2 = parts.filter(n => n.uuid === item.uuid)[0];

if (child) {
obj.add(child);
} else {
child = parts.filter(n => n.uuid === item.uuid)[0];
let child = null;

if (child1) {
obj.add(child1);

child = child1;

if (child) {
obj.add(child);
if (child2) {
// TODO: 服务端原始模型组件,需要复制反序列化后的组件的属性。
child1.name = child2.name;
}
} else if (child2) {
obj.add(child2);

child = child2;
} else {
console.warn(`ServerObject: no object with uuid ${item.uuid}.`);
}

if (child && Array.isArray(item.children) && item.children.length > 0) {
Expand Down

0 comments on commit 2503fb0

Please sign in to comment.