public class ParticSysterm : MonoBehaviour
{
private GameObject BoomExposion;
private void Update()
{
//按下A播放粒子特效并摧毁物体
if (Input .GetKeyDown (KeyCode.A ))
{
ParticleSystem shPTl = BoomExposion.GetComponent<ParticleSystem>();
shPTl.Play();
//使父对象为空
shPTl.transform.parent = null;
//粒子特效播放完成后摧毁
Destroy(shPTl ,shPTl.main.duration );
Destroy(gameObject );
}
}
}