2

As far as I understand, autoRemoveOnFinish only works only when the duration has a finite value. But what if I stop the particle system at some point, will it remove the node after no particles left? for example

CCParticleSun *particleSun = [CCParticleSun node];
particleSun.autoRemoveOnFinish = YES;
[self addChild: particleSun];

and at some point in the game I set

[particleSun stopSystem];

Will this remove the node after no particles left? Thank you in advance for helping.

user1817517
  • 349
  • 1
  • 5
  • 16

1 Answers1

3

The answer is yes.See the method -(void) update: (ccTime) dt in CCParticleSystem.m

    if( particleCount == 0 && autoRemoveOnFinish_ ) {
                [self unscheduleUpdate];
                [parent_ removeChild:self cleanup:YES];
                return;
            }

Try to set a breakpoint here to check,this will be called after no particles left.

PeakCoder
  • 852
  • 8
  • 20