From 4cd51550dcd34eddf4ddd7c0a4b2355bfdb57264 Mon Sep 17 00:00:00 2001 From: tengge1 <930372551@qq.com> Date: Fri, 28 Jun 2019 20:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E7=B3=BB=E5=88=97bu?= =?UTF-8?q?g=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.Web/src/command/AddScriptCommand.js | 4 ++-- ShadowEditor.Web/src/command/History.js | 4 ++-- ShadowEditor.Web/src/command/MoveObjectCommand.js | 4 ++-- ShadowEditor.Web/src/command/MultiCmdsCommand.js | 4 ++-- ShadowEditor.Web/src/command/RemoveObjectCommand.js | 8 ++++---- ShadowEditor.Web/src/command/RemoveScriptCommand.js | 4 ++-- ShadowEditor.Web/src/command/SetColorCommand.js | 4 ++-- ShadowEditor.Web/src/command/SetGeometryCommand.js | 8 ++++---- .../src/command/SetGeometryValueCommand.js | 12 ++++++------ .../src/command/SetMaterialColorCommand.js | 4 ++-- ShadowEditor.Web/src/command/SetMaterialCommand.js | 4 ++-- .../src/command/SetMaterialMapCommand.js | 4 ++-- .../src/command/SetMaterialValueCommand.js | 8 ++++---- ShadowEditor.Web/src/command/SetPositionCommand.js | 4 ++-- ShadowEditor.Web/src/command/SetRotationCommand.js | 4 ++-- ShadowEditor.Web/src/command/SetScaleCommand.js | 4 ++-- ShadowEditor.Web/src/command/SetSceneCommand.js | 4 ++-- .../src/command/SetScriptValueCommand.js | 8 ++++---- ShadowEditor.Web/src/command/SetUuidCommand.js | 8 ++++---- ShadowEditor.Web/src/command/SetValueCommand.js | 4 ++-- 20 files changed, 54 insertions(+), 54 deletions(-) diff --git a/ShadowEditor.Web/src/command/AddScriptCommand.js b/ShadowEditor.Web/src/command/AddScriptCommand.js index 6b576f43..e15e4f06 100644 --- a/ShadowEditor.Web/src/command/AddScriptCommand.js +++ b/ShadowEditor.Web/src/command/AddScriptCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/History.js b/ShadowEditor.Web/src/command/History.js index 159364fe..08455be2 100644 --- a/ShadowEditor.Web/src/command/History.js +++ b/ShadowEditor.Web/src/command/History.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/MoveObjectCommand.js b/ShadowEditor.Web/src/command/MoveObjectCommand.js index b934d615..23d68907 100644 --- a/ShadowEditor.Web/src/command/MoveObjectCommand.js +++ b/ShadowEditor.Web/src/command/MoveObjectCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/MultiCmdsCommand.js b/ShadowEditor.Web/src/command/MultiCmdsCommand.js index 8266ef42..663b7cb6 100644 --- a/ShadowEditor.Web/src/command/MultiCmdsCommand.js +++ b/ShadowEditor.Web/src/command/MultiCmdsCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/RemoveObjectCommand.js b/ShadowEditor.Web/src/command/RemoveObjectCommand.js index 45918dc8..e5824d22 100644 --- a/ShadowEditor.Web/src/command/RemoveObjectCommand.js +++ b/ShadowEditor.Web/src/command/RemoveObjectCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/RemoveScriptCommand.js b/ShadowEditor.Web/src/command/RemoveScriptCommand.js index 4c8a7c9d..80bcb4e2 100644 --- a/ShadowEditor.Web/src/command/RemoveScriptCommand.js +++ b/ShadowEditor.Web/src/command/RemoveScriptCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/SetColorCommand.js b/ShadowEditor.Web/src/command/SetColorCommand.js index ebf31c69..c83b0a05 100644 --- a/ShadowEditor.Web/src/command/SetColorCommand.js +++ b/ShadowEditor.Web/src/command/SetColorCommand.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/SetGeometryCommand.js b/ShadowEditor.Web/src/command/SetGeometryCommand.js index 23bd9494..f07a9a96 100644 --- a/ShadowEditor.Web/src/command/SetGeometryCommand.js +++ b/ShadowEditor.Web/src/command/SetGeometryCommand.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/SetGeometryValueCommand.js b/ShadowEditor.Web/src/command/SetGeometryValueCommand.js index c45d7676..383fb5a7 100644 --- a/ShadowEditor.Web/src/command/SetGeometryValueCommand.js +++ b/ShadowEditor.Web/src/command/SetGeometryValueCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/SetMaterialColorCommand.js b/ShadowEditor.Web/src/command/SetMaterialColorCommand.js index 269e6b36..458729fe 100644 --- a/ShadowEditor.Web/src/command/SetMaterialColorCommand.js +++ b/ShadowEditor.Web/src/command/SetMaterialColorCommand.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/SetMaterialCommand.js b/ShadowEditor.Web/src/command/SetMaterialCommand.js index 8108a39d..36c25704 100644 --- a/ShadowEditor.Web/src/command/SetMaterialCommand.js +++ b/ShadowEditor.Web/src/command/SetMaterialCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/SetMaterialMapCommand.js b/ShadowEditor.Web/src/command/SetMaterialMapCommand.js index 01b14953..2cbc25c9 100644 --- a/ShadowEditor.Web/src/command/SetMaterialMapCommand.js +++ b/ShadowEditor.Web/src/command/SetMaterialMapCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/SetMaterialValueCommand.js b/ShadowEditor.Web/src/command/SetMaterialValueCommand.js index ba77559a..cdb7bea8 100644 --- a/ShadowEditor.Web/src/command/SetMaterialValueCommand.js +++ b/ShadowEditor.Web/src/command/SetMaterialValueCommand.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/SetPositionCommand.js b/ShadowEditor.Web/src/command/SetPositionCommand.js index 4b71cc87..544cfbbf 100644 --- a/ShadowEditor.Web/src/command/SetPositionCommand.js +++ b/ShadowEditor.Web/src/command/SetPositionCommand.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/SetRotationCommand.js b/ShadowEditor.Web/src/command/SetRotationCommand.js index 62cd3b9f..966534a3 100644 --- a/ShadowEditor.Web/src/command/SetRotationCommand.js +++ b/ShadowEditor.Web/src/command/SetRotationCommand.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/SetScaleCommand.js b/ShadowEditor.Web/src/command/SetScaleCommand.js index 285acece..3cf3ff08 100644 --- a/ShadowEditor.Web/src/command/SetScaleCommand.js +++ b/ShadowEditor.Web/src/command/SetScaleCommand.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/SetSceneCommand.js b/ShadowEditor.Web/src/command/SetSceneCommand.js index 8bfcd50d..9b680797 100644 --- a/ShadowEditor.Web/src/command/SetSceneCommand.js +++ b/ShadowEditor.Web/src/command/SetSceneCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/SetScriptValueCommand.js b/ShadowEditor.Web/src/command/SetScriptValueCommand.js index c0f90858..c6a0768c 100644 --- a/ShadowEditor.Web/src/command/SetScriptValueCommand.js +++ b/ShadowEditor.Web/src/command/SetScriptValueCommand.js @@ -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) { diff --git a/ShadowEditor.Web/src/command/SetUuidCommand.js b/ShadowEditor.Web/src/command/SetUuidCommand.js index 6ed6c45d..595c27da 100644 --- a/ShadowEditor.Web/src/command/SetUuidCommand.js +++ b/ShadowEditor.Web/src/command/SetUuidCommand.js @@ -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 () { diff --git a/ShadowEditor.Web/src/command/SetValueCommand.js b/ShadowEditor.Web/src/command/SetValueCommand.js index 685e6edb..481b02e4 100644 --- a/ShadowEditor.Web/src/command/SetValueCommand.js +++ b/ShadowEditor.Web/src/command/SetValueCommand.js @@ -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) {