これは、私が CCTouchesMoved で使用して、接触する場所でパーティクル エフェクトを生成するコードです。しかし、この 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;
}
助けてください...さまざまなパーティクルを使用して、寿命と期間を最小限に抑えようとしましたが、うまくいきませんでした! そのための新しいアイデアはありますか?または私がやったことの修正?