首页 > 代码库 > cocos2dx-3.2 笔记 - schedule(类似定时器)

cocos2dx-3.2 笔记 - schedule(类似定时器)

 直接贴代码

    SEL_SCHEDULE shiftLand = schedule_selector(GameLayer::scrollLand);    this->schedule(shiftLand, 0.02f);//设置频率,每隔0.2s触发一次    this->scheduleUpdate();

 

void GameLayer::scrollLand(float dt){}

 

this->unschedule(shiftLand);