UNPKG

cocos2d-html5

Version:
32 lines (29 loc) 796 B
var SchedulerUnscheduleAllTest = 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) { this.unscheduleAllCallbacks(); } }); SchedulerUnscheduleAllTest.create = function(args){ var layer = new SchedulerUnscheduleAllTest(); return layer.init() ? layer : null; };