From 4e2da1610367945eabb88c44130b118d4742024b Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Wed, 10 Aug 2016 13:55:19 +0800 Subject: [PATCH 1/4] animation playOnLoad should handle in onEnable --- cocos2d/core/components/CCAnimation.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cocos2d/core/components/CCAnimation.js b/cocos2d/core/components/CCAnimation.js index 6743b41b2b..643857ccd8 100644 --- a/cocos2d/core/components/CCAnimation.js +++ b/cocos2d/core/components/CCAnimation.js @@ -166,16 +166,14 @@ var Animation = cc.Class({ } }, - __preload: function () { - if (CC_EDITOR || !this.enabled) return; - - if (this.playOnLoad && this._defaultClip) { + onEnable: function () { + if (!CC_EDITOR && this.playOnLoad && this._defaultClip) { + this.playOnLoad = false; + var state = this.getAnimationState(this._defaultClip.name); this._animator.playState(state); } - }, - onEnable: function () { this.resume(); }, From e04b69e55df243e73352b0cbbfb6e6ed85d652c4 Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Wed, 10 Aug 2016 14:06:16 +0800 Subject: [PATCH 2/4] refine code --- cocos2d/core/components/CCAnimation.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cocos2d/core/components/CCAnimation.js b/cocos2d/core/components/CCAnimation.js index 643857ccd8..fbb01027ff 100644 --- a/cocos2d/core/components/CCAnimation.js +++ b/cocos2d/core/components/CCAnimation.js @@ -169,12 +169,13 @@ var Animation = cc.Class({ onEnable: function () { if (!CC_EDITOR && this.playOnLoad && this._defaultClip) { this.playOnLoad = false; - + var state = this.getAnimationState(this._defaultClip.name); this._animator.playState(state); } - - this.resume(); + else { + this.resume(); + } }, onDisable: function () { From 775963c5da40d1bf1e44a31e31c64fb6aa556a89 Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Wed, 10 Aug 2016 15:15:46 +0800 Subject: [PATCH 3/4] fixed CollisionManager --- cocos2d/core/collider/CCCollisionManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/core/collider/CCCollisionManager.js b/cocos2d/core/collider/CCCollisionManager.js index e24c170593..be35bed8df 100644 --- a/cocos2d/core/collider/CCCollisionManager.js +++ b/cocos2d/core/collider/CCCollisionManager.js @@ -400,7 +400,7 @@ cc.js.getset(CollisionManager.prototype, 'enabledDebugDraw', } else if (!value && this._enabledDebugDraw) { this._debugDrawer.clear(); - cc.director.getScene()._sgNode.removeChild(this._debugDrawer); + this._debugDrawer.removeFromParent(false); cc.director.off(cc.Director.EVENT_AFTER_SCENE_LAUNCH, this.onSceneLaunched, this); } From 7e8c1a0cd849c3bfa89206bf32dfbd3941d6bd7c Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Thu, 11 Aug 2016 10:08:17 +0800 Subject: [PATCH 4/4] add syncPositionUpdate for CardinalSplineTo fireball/issues/3956 --- jsb/jsb-action.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jsb/jsb-action.js b/jsb/jsb-action.js index f8f915f803..c89043a22c 100644 --- a/jsb/jsb-action.js +++ b/jsb/jsb-action.js @@ -348,6 +348,7 @@ var actionUpdate = { 'JumpTo': syncPositionUpdate, 'JumpBy': syncPositionUpdate, 'Place': syncPositionUpdate, + 'CardinalSplineTo': syncPositionUpdate, 'RotateTo': syncRotationUpdate, 'RotateBy': syncRotationUpdate, 'ScaleTo': syncScaleUpdate,