现在的位置: 首页 > 综合 > 正文

cocos2dx教程之CCLayer schedule

2018年04月22日 ⁄ 综合 ⁄ 共 395字 ⁄ 字号 评论关闭

scheduleUpdate();

schedule(schedule_selector(SchedulerUpdateAndCustom::tick));

schedule(schedule_selector(SchedulerUpdateAndCustom::stopSelectors), 0.4f);

void SchedulerUpdateAndCustom::update(float
dt)

{   CCLOG("update
called:%f",
dt);}

void SchedulerUpdateAndCustom::tick(float
dt)

{   CCLOG("custom selector
called:%f",dt);

}

void SchedulerUpdateAndCustom::stopSelectors(float
dt)

{   unscheduleAllSelectors();

}

抱歉!评论已关闭.