35 lines
924 B
C#
35 lines
924 B
C#
using CodeJay.Enum;
|
|
using DG.Tweening;
|
|
using UnityEngine;
|
|
|
|
public class WaitForAIBehaviourPopup : PopupBase
|
|
{
|
|
[SerializeField] private UnityEngine.UI.Image hourglass;
|
|
|
|
public void SetData(float duration)
|
|
{
|
|
hourglass.rectTransform.DOLocalRotate(Vector3.back * 360, 3, RotateMode.FastBeyond360).SetLoops(-1, LoopType.Restart);
|
|
StartCoroutine(coroSelectRnd(duration));
|
|
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
|
|
}
|
|
|
|
public override void HidePopup()
|
|
{
|
|
base.HidePopup();
|
|
if (DOTween.IsTweening(hourglass.rectTransform))
|
|
hourglass.rectTransform.DOKill();
|
|
}
|
|
|
|
private System.Collections.IEnumerator coroSelectRnd(float duration)
|
|
{
|
|
float cnt = 0;
|
|
while(cnt < duration)
|
|
{
|
|
cnt += Time.deltaTime * GamePanel.GameSpeed;
|
|
yield return null;
|
|
}
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
}
|
|
}
|