public ParticleSystemStopAction stopAction;
Описание
Выберите, следует ли отключить или уничтожить игровой объект или вызвать обратный вызов сценария MonoBehaviour.OnParticleSystemStopped, когда система частиц остановится и все частицы исчезнут.
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(ParticleSystem))]
public class ExampleClass : MonoBehaviour
{
private ParticleSystem ps;
void Start()
{
ps = GetComponent<ParticleSystem>();
ps.Stop();
var main = ps.main;
main.loop = false;
main.duration = 1.0f;
main.stopAction = ParticleSystemStopAction.Destroy;
ps.Play();
}
}