cocos2d-html5
Version:
Cocos2d-HTML5 core package
32 lines (29 loc) • 844 B
JavaScript
var SchedulerUnscheduleAllHardTest = cc.Layer.extend({
ctor : function(){
this._super();
this.schedule(this.onTick1, 0.5);
this.schedule(this.onTick2, 1.0);
this.schedule(this.onTick3, 1.5);
this.schedule(this.onTick4, 1.5);
this.schedule(this.onUnscheduleAll, 4);
},
onTick1:function (dt) {
logTest("tick1");
},
onTick2:function (dt) {
logTest("tick2");
},
onTick3:function (dt) {
logTest("tick3");
},
onTick4:function (dt) {
logTest("tick4");
},
onUnscheduleAll:function (dt) {
cc.Director.getInstance().getScheduler().unscheduleAllCallbacks();
}
});
SchedulerUnscheduleAllHardTest.create = function(args){
var layer = new SchedulerUnscheduleAllHardTest();
return layer.init() ? layer : null;
};