20 lines
308 B
C#
20 lines
308 B
C#
using UnityEngine;
|
|
|
|
public class DestroyParticleOnFinish : MonoBehaviour
|
|
{
|
|
private ParticleSystem particle;
|
|
|
|
private void Awake()
|
|
{
|
|
particle = GetComponent<ParticleSystem>();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if ((bool)particle && !particle.IsAlive(true))
|
|
{
|
|
Object.Destroy(base.gameObject);
|
|
}
|
|
}
|
|
}
|