70 lines
2.8 KiB
C#
70 lines
2.8 KiB
C#
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
|
||
|
|
public enum eMiniGameItem
|
||
|
|
{
|
||
|
|
Bomb, // 사용 시점 화면 내 모든 하얀 액체 제거
|
||
|
|
Umbrella, // 피해 10초 간 피해 면역 보호막 생성
|
||
|
|
Dildo // 사용 시점 화면에 보이는 모든 투사체를 재화로 변경
|
||
|
|
}
|
||
|
|
|
||
|
|
public class MiniGameItemCard : MonoBehaviour
|
||
|
|
{
|
||
|
|
public eMiniGameItem m_Item;
|
||
|
|
public Image i_item;
|
||
|
|
public GameObject go_btnPlus;
|
||
|
|
|
||
|
|
public void Set()
|
||
|
|
{
|
||
|
|
switch (m_Item)
|
||
|
|
{
|
||
|
|
case eMiniGameItem.Bomb:
|
||
|
|
i_item.sprite = UIAtlasMgr.Ins.Get_Sprite("item_bomb");
|
||
|
|
//t_amount.text = SaveMgr.Ins.Get_Money(eMoney.ItemBomb).ToString();
|
||
|
|
go_btnPlus.SetActive(Get_ItemAmount(eMiniGameObtacleType.ItemBomb) < 5);
|
||
|
|
break;
|
||
|
|
case eMiniGameItem.Umbrella:
|
||
|
|
i_item.sprite = UIAtlasMgr.Ins.Get_Sprite("item_umbrella");
|
||
|
|
//t_amount.text = SaveMgr.Ins.Get_Money(eMoney.ItemUmbrella).ToString();
|
||
|
|
go_btnPlus.SetActive(Get_ItemAmount(eMiniGameObtacleType.ItemUmbrella) < 5);
|
||
|
|
break;
|
||
|
|
case eMiniGameItem.Dildo:
|
||
|
|
i_item.sprite = UIAtlasMgr.Ins.Get_Sprite("item_dildo");
|
||
|
|
//t_amount.text = SaveMgr.Ins.Get_Money(eMoney.ItemDildo).ToString();
|
||
|
|
go_btnPlus.SetActive(Get_ItemAmount(eMiniGameObtacleType.ItemDildo) < 5);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
int Get_ItemAmount(eMiniGameObtacleType item) { return LobbyUI.Ins.m_Game_Mini.Get_ResultMoney()[item]; }
|
||
|
|
void Use_Item(eMiniGameObtacleType item) { if (Get_ItemAmount(item) > 0) LobbyUI.Ins.m_Game_Mini.Use_Item(item); }
|
||
|
|
|
||
|
|
public void OnClick_Use()
|
||
|
|
{
|
||
|
|
switch (m_Item)
|
||
|
|
{
|
||
|
|
case eMiniGameItem.Bomb: Use_Item(eMiniGameObtacleType.ItemBomb); break;
|
||
|
|
case eMiniGameItem.Umbrella: Use_Item(eMiniGameObtacleType.ItemUmbrella); break;
|
||
|
|
case eMiniGameItem.Dildo: Use_Item(eMiniGameObtacleType.ItemDildo); break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public void OnClick_AD()
|
||
|
|
{
|
||
|
|
switch (m_Item)
|
||
|
|
{
|
||
|
|
case eMiniGameItem.Bomb:
|
||
|
|
if (Get_ItemAmount(eMiniGameObtacleType.ItemBomb) < 5)
|
||
|
|
ADInfo.Ins.Show_AD(true, () => { LobbyUI.Ins.m_Game_Mini.Add_Item(eMiniGameObtacleType.ItemBomb, 1); });
|
||
|
|
break;
|
||
|
|
case eMiniGameItem.Umbrella:
|
||
|
|
if (Get_ItemAmount(eMiniGameObtacleType.ItemUmbrella) < 5)
|
||
|
|
ADInfo.Ins.Show_AD(true, () => { LobbyUI.Ins.m_Game_Mini.Add_Item(eMiniGameObtacleType.ItemUmbrella, 1); });
|
||
|
|
break;
|
||
|
|
case eMiniGameItem.Dildo:
|
||
|
|
if (Get_ItemAmount(eMiniGameObtacleType.ItemDildo) < 5)
|
||
|
|
ADInfo.Ins.Show_AD(true, () => { LobbyUI.Ins.m_Game_Mini.Add_Item(eMiniGameObtacleType.ItemDildo, 1); });
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|