44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
|
|
using CodeJay.Enum;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
public class FloorCardSelectPopup : PopupBase
|
|||
|
|
{
|
|||
|
|
[SerializeField] private UnityEngine.UI.Image leftCardImage;
|
|||
|
|
[SerializeField] private UnityEngine.UI.Image rightCardImage;
|
|||
|
|
|
|||
|
|
private ECardType LeftCard;
|
|||
|
|
private ECardType RightCard;
|
|||
|
|
|
|||
|
|
private System.Action<ECardType> _action;
|
|||
|
|
|
|||
|
|
public void SetData(ECardType leftCardType, ECardType rightCardType, System.Action<ECardType> callback)
|
|||
|
|
{
|
|||
|
|
_action += callback;
|
|||
|
|
this.LeftCard = leftCardType;
|
|||
|
|
this.RightCard = rightCardType;
|
|||
|
|
|
|||
|
|
leftCardImage.sprite = GameManager.Resource.GetSprite(LeftCard);
|
|||
|
|
rightCardImage.sprite = GameManager.Resource.GetSprite(RightCard);
|
|||
|
|
|
|||
|
|
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void ClickLeftCard()
|
|||
|
|
{
|
|||
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|||
|
|
|
|||
|
|
_action?.Invoke(LeftCard);
|
|||
|
|
Debug.Log("<color[red><3E><><EFBFBD>õ<EFBFBD></color> ī<><C4AB> : " + LeftCard.ToString());
|
|||
|
|
GameManager.UI.HideTopPopup();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void ClickRightCard()
|
|||
|
|
{
|
|||
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|||
|
|
|
|||
|
|
_action?.Invoke(RightCard);
|
|||
|
|
Debug.Log("<color[red><3E><><EFBFBD>õ<EFBFBD></color> ī<><C4AB> : " + RightCard.ToString());
|
|||
|
|
GameManager.UI.HideTopPopup();
|
|||
|
|
}
|
|||
|
|
}
|