From 1e6e329255aedae913bf3c3f8827881147fc4074 Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Tue, 29 Dec 2015 13:18:27 +0800 Subject: [PATCH] fixed animation manager will be paused when node active is set to false --- cocos2d/animation/animation-manager.js | 1 + cocos2d/core/components/CCComponent.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cocos2d/animation/animation-manager.js b/cocos2d/animation/animation-manager.js index d798be9a77..0afe8c6910 100644 --- a/cocos2d/animation/animation-manager.js +++ b/cocos2d/animation/animation-manager.js @@ -3,6 +3,7 @@ var JS = cc.js; var AnimationManager = cc.Class({ ctor: function () { this.animators = []; + this.__instanceId = cc.ClassManager.getNewInstanceId(); }, // for manager diff --git a/cocos2d/core/components/CCComponent.js b/cocos2d/core/components/CCComponent.js index f47605f250..d9b69e0f48 100644 --- a/cocos2d/core/components/CCComponent.js +++ b/cocos2d/core/components/CCComponent.js @@ -47,8 +47,8 @@ function callOnEnable (self, enable) { self.onEnable(); } } - - cc.director.getScheduler().resumeTarget(this); + + cc.director.getScheduler().resumeTarget(self); _registerEvent(self, true); @@ -66,7 +66,7 @@ function callOnEnable (self, enable) { } } - cc.director.getScheduler().pauseTarget(this); + cc.director.getScheduler().pauseTarget(self); _registerEvent(self, false); @@ -577,7 +577,7 @@ var Component = cc.Class({ isRunning: function () { return this.enabledInHierarchy; }, - + /** *

Schedules a custom selector.
* If the selector is already scheduled, then the interval parameter will be updated without scheduling it again.