Skip to content

Commit 2354cc8

Browse files
committed
Fixed a bug that scheduleUpdate error when cc.ActionManager is null
1 parent 31c397c commit 2354cc8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cocos2d/core/CCDirector.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,12 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
154154
//scheduler
155155
this._scheduler = new cc.Scheduler();
156156
//action manager
157-
this._actionManager = cc.ActionManager ? new cc.ActionManager() : null;
158-
this._scheduler.scheduleUpdate(this._actionManager, cc.Scheduler.PRIORITY_SYSTEM, false);
157+
if(cc.ActionManager){
158+
this._actionManager = new cc.ActionManager();
159+
this._scheduler.scheduleUpdate(this._actionManager, cc.Scheduler.PRIORITY_SYSTEM, false);
160+
}else{
161+
this._actionManager = null;
162+
}
159163

160164
this._eventAfterDraw = new cc.EventCustom(cc.Director.EVENT_AFTER_DRAW);
161165
this._eventAfterDraw.setUserData(this);

0 commit comments

Comments
 (0)