82 lines
3.0 KiB
C#
82 lines
3.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Assertions.Must;
|
|
|
|
public class CollectionEquipmentUI_Info : uScrollViewMgr
|
|
{
|
|
public TextMeshProUGUI[] texts; // 0 다음 보상
|
|
public GameObject[] gos; // 0 제작 버튼
|
|
public GameObject go_noti;
|
|
|
|
CollectionEquipmentCard m_SelectCard;
|
|
EquipmentListTableData m_MakeData;
|
|
List<eAwakenUpgradeOptionType> list = new List<eAwakenUpgradeOptionType>
|
|
{
|
|
eAwakenUpgradeOptionType.STR_ADD, eAwakenUpgradeOptionType.DEX_ADD,
|
|
eAwakenUpgradeOptionType.INT_ADD, eAwakenUpgradeOptionType.LUK_ADD
|
|
};
|
|
|
|
public void Set(CollectionEquipmentCard card)
|
|
{
|
|
if (!DSUtil.CheckNull(m_SelectCard))
|
|
m_SelectCard.go_selected.SetActive(false);
|
|
|
|
m_SelectCard = card;
|
|
m_SelectCard.go_selected.SetActive(true);
|
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
var data = m_SelectCard.Get_Data() as CollectionListTableData;
|
|
m_MakeData = table_equipitemlist.Ins.Get_Data_orNull(data.n_TargetValue);
|
|
var lv = sdata.Get_CollectionLv(data.n_TargetValue);
|
|
|
|
Set_ScrollView(list);
|
|
for (int i = 0; i < list.Count; i++)
|
|
{
|
|
if (list[i] == data.n_FirstRewardValue)
|
|
list_CardBase[i].Set(lv > 0 ? data.n_FirstRewardCount : 0);
|
|
if (list[i].ToString().Equals(data.n_RepeatRewardValue))
|
|
list_CardBase[i].Set(Mathf.Max(lv - 1, 0) * data.n_RepeatRewardCount);
|
|
}
|
|
|
|
if (lv > 0)
|
|
texts[0].text = $"레벨 업 시 획득 보상\n{data.n_RepeatRewardValue} : {data.n_RepeatRewardCount}";
|
|
else
|
|
texts[0].text = $"최초 획득 보상\n{data.n_FirstRewardValue} : {data.n_FirstRewardCount}";
|
|
|
|
gos[0].SetActive(!DSUtil.CheckNull(m_MakeData) && m_MakeData.e_EquipParts == eItem.Weapon);
|
|
go_noti.SetActive(sdata.Noti_CollectionEquipment(data.e_TargetCondition, data.e_MenuCategory));
|
|
}
|
|
|
|
public void OnClick_Make()
|
|
{
|
|
if (!DSUtil.CheckNull(m_MakeData) && m_MakeData.e_EquipParts == eItem.Weapon)
|
|
PopupMgr.Ins.m_EquipmentMakePopup.Set(m_MakeData);
|
|
}
|
|
|
|
public void OnClick_GetAll()
|
|
{
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
var data = m_SelectCard.Get_Data() as CollectionListTableData;
|
|
var lst = table_collectionlist.Ins.Get_DataList(data.e_TargetCondition, data.e_MenuCategory);
|
|
for (int i = 0; i < lst.Count; i++)
|
|
{
|
|
while (true)
|
|
{
|
|
var amount = sdata.Get_ItemAmount(lst[i].n_TargetValue);
|
|
var conditon = lst[i].Get_ConditionCount(sdata.Get_CollectionLv(lst[i].n_TargetValue));
|
|
if (amount >= conditon)
|
|
{
|
|
sdata.Use_Item(lst[i].n_TargetValue, conditon);
|
|
sdata.Add_CollectionLv(lst[i].n_TargetValue);
|
|
}
|
|
else
|
|
break;
|
|
}
|
|
}
|
|
|
|
CollectionEquipmentUI.Ins.Set_UI();
|
|
MyValue.Get_ActorStatInfoorNull(eRole.PC);
|
|
}
|
|
} |