Scriptum/Assets/ParticleDisable.cs

23 lines
452 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ParticleDisable : MonoBehaviour
{
public int loadedInt;
void Update()
{
loadedInt = PlayerPrefs.GetInt("rock");
StartCoroutine(Destroy(loadedInt));
}
IEnumerator Destroy(int loaded)
{
if (loaded == 0)
{
yield return new WaitForSeconds(1);
Destroy(gameObject);
}
}
}