문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top