版本3.3.2
1、设置一个loop的粒子,playOnAwake为false
2、在代码中调用ParticleSystem.play()播放粒子
3、在代码中调用ParticleSystem.stop()停止播放粒子,这个时候,所有粒子同时消失。
看了一下源码就是这个处理的,但粒子stop后,应该是停止发射,但已发射的粒子不删除。
建议把这clear调用去掉
/**
* 停止播放粒子。
*/
public stop () {
if (this._isPlaying || this._isPaused) {
this.clear();
}
if (this._isPlaying) {
this._isPlaying = false;
}
if (this._isPaused) {
this._isPaused = false;
}
this._time = 0.0;
this._emitRateTimeCounter = 0.0;
this._emitRateDistanceCounter = 0.0;
this._isStopped = true;
// if stop emit modify the refresh flag to true
this._needRefresh = true;
}