using UnityEngine; using UnityEngine.UI; public class RewardPopupBar : MonoBehaviour { public Image bar; public GameObject receive; public float barTime = 3f; public bool isAutoClose = false; protected void AutoClose() { ShowBar(); if (isAutoClose) { StartCoroutine("AutoCloseCoroutine"); } } void ShowBar() { bar.gameObject.SetActive(isAutoClose); } protected virtual void OnDisable() { StopAllCoroutines(); } }