Error

C++博客 首页 新随笔 联系 聚合 管理
  217 Posts :: 61 Stories :: 32 Comments :: 0 Trackbacks
定时器使用:(cocos貌似没有提供详细参数文档,参数数量不一样的时候每个参数表达的含义不一样,使用如果问题,请自行读代码,否则真不知道每个参数的含义是什么)
------------------------------------------------------------------------------
1.注册定时器
//C++: js_CCScheduler_schedule
cc.director._scheduler.schedule(this, this.onTimerTest.bind(this), 1, cc.REPEAT_FOREVER, 0, false, "keyCountDownTime");
2.定时器回调原型
onTimerTest : function (interval) {
3.取消定时器
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));
------------------------------------------------------------------------------
直接调用node注册,可以省略第一个target参数
------------------------------------------------------------------------------
暂时没有发现能直接使用free函数做定时器
posted on 2017-07-12 15:20 Enic 阅读(241) 评论(0)  编辑 收藏 引用 所属分类: 从零开始写棋牌游戏平台

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理