27 lines
455 B
C#
27 lines
455 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ParticleDisable : MonoBehaviour
|
|
{
|
|
|
|
public GameObject obj;
|
|
|
|
void Update()
|
|
{
|
|
if(obj.active == false)
|
|
{
|
|
StartCoroutine(Destroy(0));
|
|
}
|
|
}
|
|
|
|
IEnumerator Destroy(int loaded)
|
|
{
|
|
if (loaded == 0)
|
|
{
|
|
yield return new WaitForSeconds(1);
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|