18 lines
278 B
C#
18 lines
278 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class ParticleDestroyer : MonoBehaviour
|
|||
|
{
|
|||
|
void OnBecameInvisible()
|
|||
|
{
|
|||
|
Debug.Log("Invisible particle");
|
|||
|
DestroyParticles();
|
|||
|
}
|
|||
|
|
|||
|
void DestroyParticles()
|
|||
|
{
|
|||
|
Destroy(gameObject);
|
|||
|
}
|
|||
|
}
|