【cocos2d-x3.5】Lua定时器Schedule

1.开始

local scheduler = cc.Director:getInstance():getScheduler()
local schedulerID = nil
schedulerID = scheduler:scheduleScriptFunc(function()
   print("Hello")
end,0,false)   

2.结束

cc.Director:getInstance():getScheduler():unscheduleScriptEntry(schedulerID) 

其他

1.延时

performWithDelay(node,function()
        print("Hello")
end,time)


已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页