mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
修复一系列bug。
This commit is contained in:
parent
ba9a3ab55d
commit
4cd51550dc
@ -29,7 +29,7 @@ Object.assign(AddScriptCommand.prototype, {
|
||||
}
|
||||
|
||||
this.editor.scripts[this.object.uuid].push(this.script);
|
||||
this.editor.app.call('scriptAdded', this, this.script);
|
||||
app.call('scriptAdded', this, this.script);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
@ -41,7 +41,7 @@ Object.assign(AddScriptCommand.prototype, {
|
||||
this.editor.scripts[this.object.uuid].splice(index, 1);
|
||||
}
|
||||
|
||||
this.editor.app.call('scriptRemoved', this, this.script);
|
||||
app.call('scriptRemoved', this, this.script);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -181,8 +181,8 @@ Object.assign(History.prototype, {
|
||||
}
|
||||
}
|
||||
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
this.editor.app.call('historyChanged', this, cmd);
|
||||
app.call('sceneGraphChanged', this);
|
||||
app.call('historyChanged', this, cmd);
|
||||
},
|
||||
|
||||
enableSerialization: function (id) {
|
||||
|
||||
@ -45,7 +45,7 @@ Object.assign(MoveObjectCommand.prototype, {
|
||||
children.splice(this.newIndex, 0, this.object);
|
||||
this.object.parent = this.newParent;
|
||||
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
@ -55,7 +55,7 @@ Object.assign(MoveObjectCommand.prototype, {
|
||||
children.splice(this.oldIndex, 0, this.object);
|
||||
this.object.parent = this.oldParent;
|
||||
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -25,14 +25,14 @@ Object.assign(MultiCmdsCommand.prototype, {
|
||||
for (var i = 0; i < this.cmdArray.length; i++) {
|
||||
this.cmdArray[i].execute();
|
||||
}
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
for (var i = this.cmdArray.length - 1; i >= 0; i--) {
|
||||
this.cmdArray[i].undo();
|
||||
}
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -33,8 +33,8 @@ Object.assign(RemoveObjectCommand.prototype, {
|
||||
this.parent.remove(this.object);
|
||||
this.editor.select(this.parent);
|
||||
|
||||
this.editor.app.call('objectRemoved', this, this.object);
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('objectRemoved', this, this.object);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
@ -44,8 +44,8 @@ Object.assign(RemoveObjectCommand.prototype, {
|
||||
this.object.parent = this.parent;
|
||||
this.editor.select(this.object);
|
||||
|
||||
this.editor.app.call('objectAdded', this, this.object);
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('objectAdded', this, this.object);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -33,7 +33,7 @@ Object.assign(RemoveScriptCommand.prototype, {
|
||||
this.editor.scripts[this.object.uuid].splice(this.index, 1);
|
||||
}
|
||||
|
||||
this.editor.app.call('scriptRemoved', this, this.script);
|
||||
app.call('scriptRemoved', this, this.script);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
@ -43,7 +43,7 @@ Object.assign(RemoveScriptCommand.prototype, {
|
||||
|
||||
this.editor.scripts[this.object.uuid].splice(this.index, 0, this.script);
|
||||
|
||||
this.editor.app.call('scriptAdded', this, this.script);
|
||||
app.call('scriptAdded', this, this.script);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -29,12 +29,12 @@ Object.assign(SetColorCommand.prototype, {
|
||||
|
||||
execute: function () {
|
||||
this.object[this.attributeName].setHex(this.newValue);
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object[this.attributeName].setHex(this.oldValue);
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
update: function (cmd) {
|
||||
|
||||
@ -30,8 +30,8 @@ Object.assign(SetGeometryCommand.prototype, {
|
||||
this.object.geometry = this.newGeometry;
|
||||
this.object.geometry.computeBoundingSphere();
|
||||
|
||||
this.editor.app.call('geometryChanged', this, this.object);
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('geometryChanged', this, this.object);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
@ -39,8 +39,8 @@ Object.assign(SetGeometryCommand.prototype, {
|
||||
this.object.geometry = this.oldGeometry;
|
||||
this.object.geometry.computeBoundingSphere();
|
||||
|
||||
this.editor.app.call('geometryChanged', this, this.object);
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('geometryChanged', this, this.object);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
update: function (cmd) {
|
||||
|
||||
@ -28,16 +28,16 @@ Object.assign(SetGeometryValueCommand.prototype, {
|
||||
|
||||
execute: function () {
|
||||
this.object.geometry[this.attributeName] = this.newValue;
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
this.editor.app.call('geometryChanged', this);
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('objectChanged', this, this.object);
|
||||
app.call('geometryChanged', this);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.geometry[this.attributeName] = this.oldValue;
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
this.editor.app.call('geometryChanged', this);
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('objectChanged', this, this.object);
|
||||
app.call('geometryChanged', this);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -29,12 +29,12 @@ Object.assign(SetMaterialColorCommand.prototype, {
|
||||
|
||||
execute: function () {
|
||||
this.object.material[this.attributeName].setHex(this.newValue);
|
||||
this.editor.app.call('materialChanged', this, this.object.material);
|
||||
app.call('materialChanged', this, this.object.material);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.material[this.attributeName].setHex(this.oldValue);
|
||||
this.editor.app.call('materialChanged', this, this.object.material);
|
||||
app.call('materialChanged', this, this.object.material);
|
||||
},
|
||||
|
||||
update: function (cmd) {
|
||||
|
||||
@ -26,12 +26,12 @@ Object.assign(SetMaterialCommand.prototype, {
|
||||
|
||||
execute: function () {
|
||||
this.object.material = this.newMaterial;
|
||||
this.editor.app.call('materialChanged', this, this.newMaterial);
|
||||
app.call('materialChanged', this, this.newMaterial);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.material = this.oldMaterial;
|
||||
this.editor.app.call('materialChanged', this, this.oldMaterial);
|
||||
app.call('materialChanged', this, this.oldMaterial);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -29,13 +29,13 @@ Object.assign(SetMaterialMapCommand.prototype, {
|
||||
execute: function () {
|
||||
this.object.material[this.mapName] = this.newMap;
|
||||
this.object.material.needsUpdate = true;
|
||||
this.editor.app.call('materialChanged', this, this.object.material);
|
||||
app.call('materialChanged', this, this.object.material);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.material[this.mapName] = this.oldMap;
|
||||
this.object.material.needsUpdate = true;
|
||||
this.editor.app.call('materialChanged', this, this.object.material);
|
||||
app.call('materialChanged', this, this.object.material);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -30,15 +30,15 @@ Object.assign(SetMaterialValueCommand.prototype, {
|
||||
execute: function () {
|
||||
this.object.material[this.attributeName] = this.newValue;
|
||||
this.object.material.needsUpdate = true;
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
this.editor.app.call('materialChanged', this, this.object.material);
|
||||
app.call('objectChanged', this, this.object);
|
||||
app.call('materialChanged', this, this.object.material);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.material[this.attributeName] = this.oldValue;
|
||||
this.object.material.needsUpdate = true;
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
this.editor.app.call('materialChanged', this, this.object.material);
|
||||
app.call('objectChanged', this, this.object);
|
||||
app.call('materialChanged', this, this.object.material);
|
||||
},
|
||||
|
||||
update: function (cmd) {
|
||||
|
||||
@ -36,13 +36,13 @@ Object.assign(SetPositionCommand.prototype, {
|
||||
execute: function () {
|
||||
this.object.position.copy(this.newPosition);
|
||||
this.object.updateMatrixWorld(true);
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.position.copy(this.oldPosition);
|
||||
this.object.updateMatrixWorld(true);
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
update: function (command) {
|
||||
|
||||
@ -36,13 +36,13 @@ Object.assign(SetRotationCommand.prototype, {
|
||||
execute: function () {
|
||||
this.object.rotation.copy(this.newRotation);
|
||||
this.object.updateMatrixWorld(true);
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.rotation.copy(this.oldRotation);
|
||||
this.object.updateMatrixWorld(true);
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
update: function (command) {
|
||||
|
||||
@ -36,13 +36,13 @@ Object.assign(SetScaleCommand.prototype, {
|
||||
execute: function () {
|
||||
this.object.scale.copy(this.newScale);
|
||||
this.object.updateMatrixWorld(true);
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.scale.copy(this.oldScale);
|
||||
this.object.updateMatrixWorld(true);
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
update: function (command) {
|
||||
|
||||
@ -39,14 +39,14 @@ Object.assign(SetSceneCommand.prototype, {
|
||||
for (var i = 0; i < this.cmdArray.length; i++) {
|
||||
this.cmdArray[i].execute();
|
||||
}
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
for (var i = this.cmdArray.length - 1; i >= 0; i--) {
|
||||
this.cmdArray[i].undo();
|
||||
}
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -37,15 +37,15 @@ Object.assign(SetScriptValueCommand.prototype, {
|
||||
execute: function () {
|
||||
this.script[this.attributeName] = this.newValue;
|
||||
|
||||
this.editor.app.call('scriptChanged', this);
|
||||
this.editor.app.call('refreshScriptEditor', this, this.object, this.script, this.cursorPosition, this.scrollInfo);
|
||||
app.call('scriptChanged', this);
|
||||
app.call('refreshScriptEditor', this, this.object, this.script, this.cursorPosition, this.scrollInfo);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.script[this.attributeName] = this.oldValue;
|
||||
|
||||
this.editor.app.call('scriptChanged', this);
|
||||
this.editor.app.call('refreshScriptEditor', this, this.object, this.script, this.cursorPosition, this.scrollInfo);
|
||||
app.call('scriptChanged', this);
|
||||
app.call('refreshScriptEditor', this, this.object, this.script, this.cursorPosition, this.scrollInfo);
|
||||
},
|
||||
|
||||
update: function (cmd) {
|
||||
|
||||
@ -27,14 +27,14 @@ Object.assign(SetUuidCommand.prototype, {
|
||||
|
||||
execute: function () {
|
||||
this.object.uuid = this.newUuid;
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('objectChanged', this, this.object);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object.uuid = this.oldUuid;
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
this.editor.app.call('sceneGraphChanged', this);
|
||||
app.call('objectChanged', this, this.object);
|
||||
app.call('sceneGraphChanged', this);
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
|
||||
@ -29,12 +29,12 @@ Object.assign(SetValueCommand.prototype, {
|
||||
|
||||
execute: function () {
|
||||
this.object[this.attributeName] = this.newValue;
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
undo: function () {
|
||||
this.object[this.attributeName] = this.oldValue;
|
||||
this.editor.app.call('objectChanged', this, this.object);
|
||||
app.call('objectChanged', this, this.object);
|
||||
},
|
||||
|
||||
update: function (cmd) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user