Project_WL/Assets/Script/UI/PC/Info/PCInfoUI_Center.cs

52 lines
1.7 KiB
C#
Raw Normal View History

2024-12-15 01:39:39 +00:00
using TMPro;
using UnityEngine;
2024-12-30 05:00:34 +00:00
public class PCInfoUI_Center : UI3DModel
2024-12-15 01:39:39 +00:00
{
2025-02-14 23:33:26 +00:00
public PetCard m_MyPet;
2024-12-15 01:39:39 +00:00
public TextMeshProUGUI[] texts; // 0 코스튬 이름, 1 코스튬 대사
2024-12-31 04:49:01 +00:00
public GameObject[] gos; // 0 코스튬 착용 버튼
2024-12-15 01:39:39 +00:00
2025-07-17 00:38:14 +00:00
CardBase SelectCard;
2024-12-31 03:16:50 +00:00
2025-07-17 00:38:14 +00:00
public void Set(CardBase choiceCard)
2024-12-15 01:39:39 +00:00
{
2025-02-14 23:33:26 +00:00
var sdata = ServerInfo.Ins.m_ServerData;
2024-12-31 03:16:50 +00:00
if (!DSUtil.CheckNull(SelectCard))
2025-07-16 18:19:14 +00:00
SelectCard.Set_Selected(false);
2024-12-31 03:16:50 +00:00
SelectCard = choiceCard;
2025-07-16 18:19:14 +00:00
SelectCard.Set_Selected(true);
2025-07-30 00:23:52 +00:00
var costumeid = SelectCard.Get_IntData();
2024-12-31 03:16:50 +00:00
2025-07-17 04:07:13 +00:00
PCInfoUI.Ins.m_PCInfoUI_List.m_PCCostumeListUI.Select_Costume(choiceCard);
2025-07-30 00:23:52 +00:00
if (NewGameUI.Ins.m_PCUI.Get_EnterID(eItem.PCCostume) == 0)
2025-02-14 23:33:26 +00:00
{
m_MyPet.Set(table_petlist.Ins.Get_Data_orNull(sdata.Get_EqiupmentEquip(eItem.Pet)));
m_MyPet.Set_CardType(eUICardType.NoTouch);
2025-07-30 00:23:52 +00:00
NewGameUI.Ins.m_PCUI.Set_EnterID(eItem.PCCostume, costumeid);
2025-02-14 23:33:26 +00:00
}
2024-12-31 06:30:12 +00:00
2024-12-31 04:49:01 +00:00
var costumeData = table_costumelist.Ins.Get_Data_orNull(costumeid);
2025-04-10 05:13:09 +00:00
texts[0].text = costumeData.Get_Name();
texts[1].text = costumeData.Get_Desc();
2025-02-17 22:30:54 +00:00
Set_2DIlust(costumeData);
2025-02-17 23:53:54 +00:00
Set_3DModel(true, costumeData.s_Prefab, tr => { tr.GetComponent<PCActor>().Set_Obj(); });
RawImage_costume.enabled = false;
2024-12-31 04:49:01 +00:00
gos[0].SetActive(CanEquip());
}
bool CanEquip()
{
var sdata = ServerInfo.Ins.m_ServerData;
var costumeid = SelectCard.Get_IntData();
if (sdata.Get_EqiupmentEquip(eItem.PCCostume) == costumeid || !sdata.IsObtainItem(costumeid))
return false;
return true;
2024-12-15 01:39:39 +00:00
}
2024-12-31 03:16:50 +00:00
2025-07-17 04:07:13 +00:00
public CardBase Get_SelectCard() { return SelectCard; }
2024-12-15 01:39:39 +00:00
}