Scriptum/Assets/ParticleDisable.cs
2022-06-15 14:59:30 +02:00

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);
}
}
}