2025-03-17 07:34:17 +00:00
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class MissionCard : CardBase
|
|
|
|
|
{
|
|
|
|
|
public Image[] images; // 0 보상 아이콘, 1 보상 버튼
|
|
|
|
|
public TextMeshProUGUI[] texts; // 0 조건, 1 보상수량, 2 진행상황
|
|
|
|
|
public Slider slider_proc;
|
|
|
|
|
|
|
|
|
|
MissionListTableData m_Data;
|
|
|
|
|
|
|
|
|
|
public override void Set<T>(T _base)
|
|
|
|
|
{
|
|
|
|
|
base.Set(_base);
|
|
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
|
m_Data = _base as MissionListTableData;
|
|
|
|
|
var amount = sdata.Get_MissionCount(m_Data.n_MissionGroupId, m_Data.n_MissionIndex);
|
|
|
|
|
|
|
|
|
|
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(m_Data.n_RewardValue);
|
2025-03-18 04:09:31 +00:00
|
|
|
switch (m_Data.e_MissionConditionType)
|
|
|
|
|
{
|
|
|
|
|
case ePurpose.KILL_MONSTER:
|
|
|
|
|
var mob = table_monsterlist.Ins.Get_Data_orNull(m_Data.n_MissionConditionValue);
|
|
|
|
|
texts[0].text = DSUtil.Format(m_Data.n_MissionDesc, mob.Get_Name());
|
|
|
|
|
break;
|
|
|
|
|
case ePurpose.TAKE_GOODS:
|
|
|
|
|
case ePurpose.CONSUME_GOODS:
|
2025-03-18 06:04:31 +00:00
|
|
|
case ePurpose.GET_EQUIPEMENT:
|
2025-03-18 22:48:03 +00:00
|
|
|
case ePurpose.RELIC_TAKE:
|
|
|
|
|
case ePurpose.RELIC_UPGRADE:
|
2025-03-18 04:09:31 +00:00
|
|
|
var item = table_itemlist.Ins.Get_Data(m_Data.n_MissionConditionValue);
|
|
|
|
|
texts[0].text = DSUtil.Format(m_Data.n_MissionDesc, item.Get_Name());
|
|
|
|
|
break;
|
|
|
|
|
case ePurpose.MOVE_MAP:
|
|
|
|
|
var map = table_battlemapconfig.Ins.Get_Data(m_Data.n_MissionConditionValue);
|
|
|
|
|
texts[0].text = DSUtil.Format(m_Data.n_MissionDesc, map.Get_Name());
|
|
|
|
|
break;
|
2025-03-18 04:25:43 +00:00
|
|
|
case ePurpose.GET_SKILL:
|
|
|
|
|
case ePurpose.SKILL_UPGRADE:
|
|
|
|
|
case ePurpose.SKILL_UPGRADE_LIMIT:
|
|
|
|
|
var skill = table_skilllist.Ins.Get_Data_orNull(m_Data.n_MissionConditionValue);
|
|
|
|
|
texts[0].text = DSUtil.Format(m_Data.n_MissionDesc, skill.Get_Name());
|
|
|
|
|
break;
|
2025-03-18 04:09:31 +00:00
|
|
|
default:
|
|
|
|
|
texts[0].text = DSUtil.Format(m_Data.n_MissionDesc);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2025-03-17 07:34:17 +00:00
|
|
|
texts[1].text = m_Data.n_RewardCount.ToString();
|
|
|
|
|
texts[2].text = $"{amount}/{m_Data.l_MissionConditionCount}";
|
|
|
|
|
slider_proc.value = DSUtil.Get_SliderValue(amount / (float)m_Data.l_MissionConditionCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void OnClick_GetReward()
|
|
|
|
|
{
|
2025-03-17 23:31:46 +00:00
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
|
if (sdata.CanGet_Mission(m_Data.n_MissionGroupId, m_Data.n_MissionIndex))
|
|
|
|
|
{
|
|
|
|
|
Popup.Ins.Set(ePopupType.One, 174, null, null, "미션 보상 받을 수 있음");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
Popup.Ins.Set(ePopupType.One, 174, null, null, "미션 보상 받을 수 없음");
|
2025-03-17 07:34:17 +00:00
|
|
|
}
|
|
|
|
|
}
|