cocos-lua 延时执行 和 scheduler

1.开始

[plain]  view plain  copy
 
  1. local scheduler = cc.Director:getInstance():getScheduler()  
  2. local schedulerID = nil  
  3. schedulerID = scheduler:scheduleScriptFunc(function()  
  4.    print("Hello")  
  5. end,0,false)     

2.结束

[plain]  view plain  copy
 
  1. cc.Director:getInstance():getScheduler():unscheduleScriptEntry(schedulerID)   

其他

1.延时

[plain]  view plain  copy
 
  1. performWithDelay(node,function()  
  2.         print("Hello")  
  3. end,time)  

你可能感兴趣的:(cocos2d-lua)