示例#1
0
void AutoAttackComponent::stopAttack()
{
    CCLOG("AutoAttackComponent::stopAttack");
    CCDirector* director = CCDirector::sharedDirector();
    CCScheduler* pScheduler = director->getScheduler();
    pScheduler->unscheduleSelector(schedule_selector(AutoAttackComponent::updateAttack),this);
}
示例#2
0
void HeartBeatPackageSender::EndSender()
{
    CCScheduler * pSchedule = CCDirector::sharedDirector()->getScheduler();
    if (pSchedule)
    {
        pSchedule->unscheduleSelector(schedule_selector(HeartBeatPackageSender::SendHeartBeatMessage),
                                      this);
    }
}
示例#3
0
文件: NDTimer.cpp 项目: chaosren/HHHH
NDTimer::~NDTimer()
{
	DEC_NDOBJ("NDTimer");

	CCScheduler *sch = GetScheduler();
	MAP_TIMER::iterator it = m_mapTimer.begin();
	for (; it != m_mapTimer.end(); it++)
	{
		Timer *timer = it->second;
		sch->unscheduleSelector(schedule_selector(Timer::onTimer), timer);
		timer->release();
	}
}
示例#4
0
/**
 * 停止移动
 * 取消移动动画的定时器
 */
void SimpleMoveComponent::stopMove()
{
//	if(m_moveState==MoveStart){
//		m_moveState=MoveWillStop;
//	}else {
		CCDirector* director = CCDirector::sharedDirector();
        CCScheduler* pScheduler = director->getScheduler();
        pScheduler->unscheduleSelector(m_update, this);
		m_moveState=MoveStop;
		//NSLog(@"stop entity move schedule:update");
		didMoveStop();
//	}
}
示例#5
0
文件: NDTimer.cpp 项目: chaosren/HHHH
void NDTimer::KillTimer(ITimerCallback* timerCallback, OBJID tag)
{
	IMP_CALLBACK cbImp;
	cbImp.tag = tag;
	cbImp.timerCallback = timerCallback;

	MAP_TIMER::iterator it = m_mapTimer.find(cbImp);

	if (it != m_mapTimer.end())
	{
		CCScheduler *sch = GetScheduler();
		Timer *timer = it->second;
		sch->unscheduleSelector(schedule_selector(Timer::onTimer), timer);
		timer->release();
		m_mapTimer.erase(it);
	}
}
void CCResourceLoader::doLoad(float delta) {
    if(m_remainingIdle > 0) {
        m_remainingIdle -= delta;
    } else if(m_loadTaskList.size() <= m_nextLoad) {
        if(m_listener)
            m_listener->onResourceLoadingDone();
        
        CCScheduler* scheduler = CCDirector::sharedDirector()->getScheduler();
        scheduler->unscheduleSelector(schedule_selector(CCResourceLoader::doLoad), this);
        autorelease();
    } else {
        LoadTask* lp = m_loadTaskList.at(m_nextLoad++);
        m_remainingIdle = lp->idle;
        
        lp->load();
        if(m_listener)
            m_listener->onResourceLoadingProgress(m_nextLoad * 100 / m_loadTaskList.size());
    }
}