2014-06-16 2 views
7

CAEmitterLayer 및 CAEmitterCell 인스턴스로 파티클 애니메이션을 생성 중입니다. 애니메이션에는 문제가 없지만 천천히 페이드 아웃하기를 원합니다. 아래의 코드를 사용하고 있지만 입자가 갑자기 사라지고 애니메이션이 사라지지 않습니다.이미 터셀을 코어 애니메이션으로 페이드 아웃

 NSString *animationPath = [NSString stringWithFormat:@"emitterCells.%@.birthRate", cell.name]; 
     CABasicAnimation *birthRateAnimation = [CABasicAnimation animationWithKeyPath:animationPath]; 
     birthRateAnimation.fromValue = [NSNumber numberWithFloat:30.0]; 
     birthRateAnimation.toValue = [NSNumber numberWithFloat:0.0]; 
     birthRateAnimation.removedOnCompletion = NO; 
     birthRateAnimation.duration = 10.0; 
     [emitterLayer addAnimation:birthRateAnimation forKey:@"birthRate"]; 

이 코드는 5 개의 다른 이미 터 셀에 대해 for 루프에서 실행됩니다.

이 코드에서 오류가 발견 되었습니까?

감사합니다.

+0

안녕하세요 Élodie, 이미 터 셀을 페이드 아웃하는 방법을 찾았습니까? –

답변

14

CAEmitterCell의 경우 알파 속도 값을 -1.0/수명으로 설정합니다.

관련 문제