Exemplo n.º 1
0
void EditorWeapon::groupFireEnd() {
    EnemyPlane* plane = dynamic_cast<EnemyPlane*>(this->getParent()->getParent());
    if(plane && plane->m_isAutoFire && !plane->m_haveCallBack) {
        plane->m_haveCallBack = true;
        plane->runAction(Sequence::create(DelayTime::create(this->fireGroupInterval),CallFunc::create(CC_CALLBACK_0(EnemyPlane::StartFire,plane)), nullptr));
    }

    if(this->isOneTime) {
//        this->unscheduleUpdate();
        this->unschedule(CC_SCHEDULE_SELECTOR(EditorWeapon::mainLoop));
        this->removeFromParent();
    }
}