From 653e35f3e9bb0785b2e08c4530a5a3f1998f7a39 Mon Sep 17 00:00:00 2001 From: liteng <930372551@qq.com> Date: Mon, 7 Jan 2019 20:44:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.Web/src/editor/StatusBar.js | 3 +-- .../src/player/component/physics/ThrowBallEvent.js | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ShadowEditor.Web/src/editor/StatusBar.js b/ShadowEditor.Web/src/editor/StatusBar.js index 1d28a44e..f4034d39 100644 --- a/ShadowEditor.Web/src/editor/StatusBar.js +++ b/ShadowEditor.Web/src/editor/StatusBar.js @@ -53,7 +53,6 @@ StatusBar.prototype.render = function () { }, { xtype: 'checkbox', id: 'cbThrowBall', - scope: this.id, onChange: this.onEnableThrowBall.bind(this) }] }] @@ -111,7 +110,7 @@ StatusBar.prototype.onUpdateInfo = function () { }; StatusBar.prototype.onEnableThrowBall = function () { - var enabled = UI.get('cbThrowBall', this.id); + var enabled = UI.get('cbThrowBall'); this.app.call('enableThrowBall', this, enabled.getValue()); }; diff --git a/ShadowEditor.Web/src/player/component/physics/ThrowBallEvent.js b/ShadowEditor.Web/src/player/component/physics/ThrowBallEvent.js index ef002a13..19f04750 100644 --- a/ShadowEditor.Web/src/player/component/physics/ThrowBallEvent.js +++ b/ShadowEditor.Web/src/player/component/physics/ThrowBallEvent.js @@ -22,6 +22,9 @@ ThrowBallEvent.prototype.create = function (scene, camera, renderer) { this.scene = scene; this.camera = camera; this.renderer = renderer; + + this.enabled = UI.get('cbThrowBall').getValue(); + this.app.on(`click.${this.id}`, this.throwBall.bind(this)); this.app.on(`enableThrowBall.${this.id}`, this.onEnableThrowBall.bind(this)); };