网上演练贵港万达广场(人员密集)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
462 B

using UnityEngine;
using System.Collections;
public class DestroyParticle : MonoBehaviour
{
void Start()
{
//开启协程
StartCoroutine(CreateParticle());
}
IEnumerator CreateParticle()
{
//当粒子还在播放中
while (gameObject.GetComponent<ParticleSystem>().isPlaying)
{
yield return null; //条到下一帧
}
Destroy(gameObject); //粒子播放结束
}
}