定時(shí)器使用:(cocos貌似沒(méi)有提供詳細(xì)參數(shù)文檔,參數(shù)數(shù)量不一樣的時(shí)候每個(gè)參數(shù)表達(dá)的含義不一樣,使用如果問(wèn)題,請(qǐng)自行讀代碼,否則真不知道每個(gè)參數(shù)的含義是什么)
------------------------------------------------------------------------------
1.注冊(cè)定時(shí)器
//C++: js_CCScheduler_schedule
cc.director._scheduler.schedule(this, this.onTimerTest.bind(this), 1, cc.REPEAT_FOREVER, 0, false, "keyCountDownTime");
2.定時(shí)器回調(diào)原型
onTimerTest : function (interval) {
3.取消定時(shí)器
cc.director._scheduler.unschedule("keyCountDownTime", this);
------------------------------------------------------------------------------
cc.director._scheduler.schedule(this, this.onTimerTest.bind(this), 1);
cc.director._scheduler.unschedule(this, this.onTimerTest.bind(this));
------------------------------------------------------------------------------
直接調(diào)用node注冊(cè),可以省略第一個(gè)target參數(shù)
------------------------------------------------------------------------------
暫時(shí)沒(méi)有發(fā)現(xiàn)能直接使用free函數(shù)做定時(shí)器