도감 카드 베이스
This commit is contained in:
parent
6d1b188f53
commit
63fafe9b36
|
|
@ -0,0 +1,44 @@
|
|||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class CollectionEMCardBase : CardBase
|
||||
{
|
||||
public Image[] images; // 0 아이콘
|
||||
public TextMeshProUGUI[] texts; // 0 이름, 1 보유효과, 2 보유/필요. 3 보유효과 값
|
||||
public Slider slider_proc;
|
||||
public GameObject go_getreward, go_selected;
|
||||
|
||||
protected CollectionListTableData m_Data;
|
||||
|
||||
public override void Set<T>(T _base)
|
||||
{
|
||||
base.Set(_base);
|
||||
m_Data = _base as CollectionListTableData;
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
|
||||
texts[1].text = MyText.Get_eAwakenUpgradeOptionTypeName(m_Data.n_RepeatRewardValue);
|
||||
texts[3].text = m_Data.n_RepeatRewardCount.ToString();
|
||||
var amount = sdata.Get_ItemAmount(m_Data.n_TargetValue);
|
||||
var lv = sdata.Get_CollectionLv(m_Data.n_TargetValue);
|
||||
var count = m_Data.Get_ConditionCount(lv);
|
||||
texts[2].text = $"{amount}/{count}";
|
||||
slider_proc.value = DSUtil.Get_SliderValue((float)(amount / count));
|
||||
|
||||
go_getreward.SetActive(amount >= count);
|
||||
go_selected.SetActive(false);
|
||||
}
|
||||
|
||||
public override TableDataBase Get_Data() { return m_Data; }
|
||||
public override void Set_Selected(bool active) { go_selected.SetActive(active); }
|
||||
|
||||
protected bool CanGet(bool showtoast)
|
||||
{
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
var lv = sdata.Get_CollectionLv(m_Data.n_TargetValue);
|
||||
return sdata.Check_ItemAmount(m_Data.n_TargetValue, m_Data.Get_ConditionCount(lv), showtoast);
|
||||
}
|
||||
|
||||
public virtual void OnClick_Card() { }
|
||||
public virtual void OnClick_GetReward() { }
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 56ce2f377cd0e814e9ae6bb93fbe5b39
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,57 +1,24 @@
|
|||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class CollectionEquipmentCard : CardBase
|
||||
public class CollectionEquipmentCard : CollectionEMCardBase
|
||||
{
|
||||
public Image[] images; // 0 아이콘
|
||||
public TextMeshProUGUI[] texts; // 0 이름, 1 보유효과, 2 보유/필요. 3 보유효과 값
|
||||
public Slider slider_proc;
|
||||
public GameObject go_getreward, go_selected;
|
||||
|
||||
CollectionListTableData m_Data;
|
||||
|
||||
public override void Set<T>(T _base)
|
||||
{
|
||||
base.Set(_base);
|
||||
m_Data = _base as CollectionListTableData;
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
var itemData = table_itemlist.Ins.Get_Data(m_Data.n_TargetValue);
|
||||
if (DSUtil.CheckNull(itemData)) return;
|
||||
if (DSUtil.CheckNull(itemData))
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
//images[0].sprite = UIAtlasMgr.Ins.Get_GradeSprite(itemData.n_ItemGrade);
|
||||
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(itemData.n_ItemID);
|
||||
|
||||
texts[0].text = table_itemlist.Ins.Get_ItemName(itemData.n_ItemID);
|
||||
texts[1].text = MyText.Get_eAwakenUpgradeOptionTypeName(m_Data.n_RepeatRewardValue);
|
||||
texts[3].text = m_Data.n_RepeatRewardCount.ToString();
|
||||
var amount = sdata.Get_ItemAmount(m_Data.n_TargetValue);
|
||||
var lv = sdata.Get_CollectionLv(m_Data.n_TargetValue);
|
||||
var count = m_Data.Get_ConditionCount(lv);
|
||||
texts[2].text = $"{amount}/{count}";
|
||||
slider_proc.value = DSUtil.Get_SliderValue((float)(amount / count));
|
||||
|
||||
go_getreward.SetActive(amount >= count);
|
||||
go_selected.SetActive(false);
|
||||
}
|
||||
|
||||
public override TableDataBase Get_Data() { return m_Data; }
|
||||
public override void OnClick_Card() { CollectionEquipmentUI.Ins.Set_SelectCard(this); }
|
||||
|
||||
bool CanGet(bool showtoast)
|
||||
{
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
var lv = sdata.Get_CollectionLv(m_Data.n_TargetValue);
|
||||
return sdata.Check_ItemAmount(m_Data.n_TargetValue, m_Data.Get_ConditionCount(lv), showtoast);
|
||||
}
|
||||
|
||||
public override void Set_Selected(bool active) { go_selected.SetActive(active); }
|
||||
|
||||
public void OnClick_Card()
|
||||
{
|
||||
CollectionEquipmentUI.Ins.Set_SelectCard(this);
|
||||
}
|
||||
|
||||
public void OnClick_GetReward()
|
||||
public override void OnClick_GetReward()
|
||||
{
|
||||
if (CanGet(true))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue