贵港中石油多角色网上演练
 
 
 

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); //粒子播放结束
}
}