这是我在 CCTouchesMoved 中使用的代码,用于在触摸位置产生粒子效果。但是,在使用此 FPS 时,当触摸移动时,FPS 会下降到 20!我试过降低粒子的寿命和持续时间(你可以在代码中看到).....
如何解决在使用粒子效果时移动触摸时 FPS 降低的问题???
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
location = [touch locationInView:[touch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
swipeEffect = [CCParticleSystemQuad particleWithFile:@"comet.plist"];
//Setting some parameters for the effect
swipeEffect.position = ccp(location.x, location.y);
//For fixing the FPS issue I deliberately lowered the life & duration
swipeEffect.life =0.0000000001;
swipeEffect.duration = 0.0000000001;
//Adding and removing after effects
[self addChild:swipeEffect];
swipeEffect.autoRemoveOnFinish=YES;
}
请帮帮我...我尝试使用不同的粒子并最小化寿命和持续时间,但没有奏效!有什么新想法吗?或修复我所做的事情?