52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using CodeJay.Enum;
|
|
using UnityEngine;
|
|
|
|
public class ShakeSelectPopup : PopupBase
|
|
{
|
|
[SerializeField] private UnityEngine.UI.Image[] Images;
|
|
|
|
private ECardType[] cardTypes;
|
|
private bool _isFourCard;
|
|
public void SetData(ECardType[] types, bool fourCard)
|
|
{
|
|
cardTypes = types;
|
|
_isFourCard = fourCard;
|
|
for (int i = 0; i < Images.Length; i++)
|
|
{
|
|
if (i == Images.Length - 1)
|
|
{
|
|
if (fourCard)
|
|
{
|
|
Images[i].gameObject.SetActive(true);
|
|
ECardType target = cardTypes[i];
|
|
Images[i].sprite = GameManager.Resource.GetSprite(target);
|
|
}
|
|
else
|
|
Images[i].gameObject.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
ECardType target = cardTypes[i];
|
|
Images[i].sprite = GameManager.Resource.GetSprite(target);
|
|
}
|
|
}
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
|
|
}
|
|
|
|
public void ClickOkay()
|
|
{
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeGameData);
|
|
GameManager.UI.HideTopPopup();
|
|
var sp = GameManager.UI.ShowNStackPopup<ShakePopup>(EPopupType.ShakePopup);
|
|
sp.SetData(cardTypes, _isFourCard);
|
|
}
|
|
|
|
public void ClickNo()
|
|
{
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
GameManager.UI.HideTopPopup();
|
|
}
|
|
}
|