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