public ParticleSystemStopAction stopAction ;

描述

配置当粒子系统停止并且所有粒子都湮灭时,GameObject 是自动禁用还是销毁自己。

using UnityEngine;
using System.Collections;

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(); } }