2013-04-20 52 views

回答

1

不正式。但是你可以編輯源代碼,添加一個布爾屬性paused並檢查暫停標誌的更新方法:

-(void) update:(ccTime)delta 
{ 
    if (_paused == NO) 
    { 
     // update particles code here... 
    } 
} 

不能保證它會工作,但它是值得試一試。

它也可以在不改變代碼,但是這會影響其他計劃方法和行動太:

[particleSystem pauseSchedulerAndActions]; 

要恢復:

[particleSystem resumeSchedulerAndActions]; 
0

另一個技巧是我用過,是setEmissionRate ()函數。 若要暫停粒子系統:

setEmissionRate(0);

要恢復粒子系統:

setEmissionRate(latestValue);

我希望這對你有好處:)