예제 #1
0
void ParticleMainScene::step(float dt)
{
    CCLabelAtlas *atlas = (CCLabelAtlas*) getChildByTag(kTagLabelAtlas);
    CCParticleSystem *emitter = (CCParticleSystem*) getChildByTag(kTagParticleSystem);

    char str[10] = {0};
    sprintf(str, "%4d", emitter->getParticleCount());
    atlas->setString(str);
}
예제 #2
0
/**
 * If the particle system has exhausted and it is set to auto-remove, remove this
 * node from the scene so that this node and the particle system will be released.
 */
void CC3ParticleSystemBillboard::updateBeforeTransform( CC3NodeUpdatingVisitor* visitor )
{
	if ( m_pBillboard ) 
	{
		CCParticleSystem* ps = (CCParticleSystem*)m_pBillboard;
		if ( ps->isAutoRemoveOnFinish() && !ps->isActive() && ps->getParticleCount() == 0 )
		{
			CC3_TRACE("[bbd]2D particle system exhausted. Removing");
			visitor->requestRemovalOf( this );
		}
	}
}