27 lines
526 B
C#
27 lines
526 B
C#
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();
|
|
}
|
|
}
|