2024-12-15 01:39:39 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class FarmInvenUI : BotMenuBase
|
|
|
|
|
{
|
|
|
|
|
public static FarmInvenUI Ins;
|
|
|
|
|
private void Start() { Ins = this; }
|
|
|
|
|
|
|
|
|
|
public ArrowUI m_ArrowUI;
|
|
|
|
|
public Image[] images; // 0 열매
|
|
|
|
|
public TextMeshProUGUI[] texts; // 0 이름, 1 설명, 2 스탯 증가량, 3 갯수, 4 먹은 갯수
|
|
|
|
|
|
|
|
|
|
FarmInvenCard SelectCard;
|
|
|
|
|
List<int> list_fruit = new List<int>();
|
|
|
|
|
|
|
|
|
|
public override void Set()
|
|
|
|
|
{
|
|
|
|
|
base.Set();
|
|
|
|
|
if (list_fruit.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_STR"));
|
|
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_DEX"));
|
|
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_INT"));
|
|
|
|
|
list_fruit.Add(table_GlobalValue.Ins.Get_Int("AWAKEN_GOODS_LUK"));
|
|
|
|
|
list_fruit.Add(455);
|
|
|
|
|
}
|
|
|
|
|
Set_ScrollView(list_fruit);
|
|
|
|
|
|
|
|
|
|
Set_SelectCard(DSUtil.CheckNull(SelectCard) ? list_CardBase[0] as FarmInvenCard : SelectCard);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Set_SelectCard(FarmInvenCard card)
|
|
|
|
|
{
|
|
|
|
|
if (!DSUtil.CheckNull(SelectCard))
|
|
|
|
|
SelectCard.go_select.SetActive(false);
|
|
|
|
|
|
|
|
|
|
SelectCard = card;
|
|
|
|
|
SelectCard.go_select.SetActive(true);
|
|
|
|
|
|
|
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
|
var id = SelectCard.Get_FruitID();
|
|
|
|
|
var itemData = table_itemlist.Ins.Get_Data(id);
|
|
|
|
|
var amount = (int)sdata.Get_ItemAmount(id);
|
|
|
|
|
|
|
|
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(id);
|
2024-12-22 01:07:25 +00:00
|
|
|
texts[0].text = table_itemlist.Ins.Get_ItemName(itemData.n_ItemID);
|
|
|
|
|
texts[1].text = table_itemlist.Ins.Get_ItemDesc(itemData.n_ItemID);
|
2024-12-15 01:39:39 +00:00
|
|
|
texts[2].text = table_fruit.Ins.Get_Data_orNull(id).Get_Desc();
|
|
|
|
|
texts[3].text = amount.ToString();
|
|
|
|
|
texts[4].text = $"(확인용)먹은 갯수 : {sdata.Get_EatFruitCount(id)}";
|
|
|
|
|
|
|
|
|
|
m_ArrowUI.Set(totalcount => { }, amount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnClick_Eat()
|
|
|
|
|
{
|
|
|
|
|
if (m_ArrowUI.Get_TotalCount() > 0)
|
|
|
|
|
{
|
|
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
|
var id = SelectCard.Get_FruitID();
|
|
|
|
|
sdata.Use_Item(id, m_ArrowUI.Get_TotalCount());
|
|
|
|
|
sdata.Add_EatFruitCount(id, m_ArrowUI.Get_TotalCount());
|
|
|
|
|
Set();
|
|
|
|
|
MyValue.Get_ActorStatInfoorNull(eRole.PC);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|