OneShotOneKill/Assets/Script/UGUI/Lobby/MainMenu/1_Hero/HeroSpecificityCard.cs

43 lines
1.8 KiB
C#
Raw Normal View History

2026-01-07 21:27:42 +00:00
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class HeroSpecificityCard : CardBase
{
static Dictionary<eGrade, List<Color32>> dic_gradecolor = new Dictionary<eGrade, List<Color32>>
{
{ eGrade.Common, new List<Color32>{ new Color32(176, 160, 153, 255), new Color32(90, 90, 90, 255) } },
{ eGrade.UnCommon, new List<Color32>{ new Color32(161, 189, 9, 255), new Color32(45, 101, 0, 255) } },
{ eGrade.Rare, new List<Color32>{ new Color32(33, 204, 203, 255), new Color32(0, 110, 138, 255) } },
{ eGrade.Hero, new List<Color32>{ new Color32(255, 197, 21, 255), new Color32(190, 148, 0, 255) } },
{ eGrade.Legend, new List<Color32>{ new Color32(191, 106, 219, 255), new Color32(132, 47, 160, 255) } },
};
public Image[] images_grade;
public Image[] images; // 0 특성 아이콘
public TextMeshProUGUI[] texts; // 0 효과유형, 1 효과대상, 2 설명
public GameObject[] gos; // 0 잠김
public override void Set<T>(T _base)
{
base.Set(_base);
var m_Data = _base as StatusOptionSetTableData;
// 정인호 : 특성 등급은 각성값을 참조해야 함
images_grade[0].color = dic_gradecolor[eGrade.Common][0];
images_grade[1].color = dic_gradecolor[eGrade.Common][1];
images[0].sprite = UIAtlasMgr.Ins.Get_Sprite(m_Data.s_Icon);
texts[2].text = m_Data.Get_Desc();
}
public override void Set(int index)
{
var pcid = LobbyUIManager.Ins.Get_MainMenu<MainMenu_Hero>(MainMenuType.Hero).Get_SelectPCID();
var pcdata = table_pclist.Ins.Get_Data_orNull(pcid);
texts[0].text = table_localtext.Ins.Get_Text(pcdata.list_Specificity_Effect[index]);
texts[1].text = table_localtext.Ins.Get_Text(pcdata.list_Specificity_Target[index]);
}
}