using System.Collections; using UnityEngine; public class TimedHide : MonoBehaviour { public void Show() { base.GetComponent().enabled = true; base.StartCoroutine(this.HideCountdown()); } private void Start() { base.StartCoroutine(this.HideCountdown()); } private IEnumerator HideCountdown() { yield return new WaitForSeconds(this.lifeTime); base.GetComponent().enabled = false; yield break; } [SerializeField] private float lifeTime = 1f; }