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

52 lines
1.5 KiB
C#

using CodeStage.AntiCheat.ObscuredTypes;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class PCInfoStatMgrCard : CardBase
{
public PCInfoStatMgrCard_Stats m_PCInfoStatMgrCard_Stats;
public TextMeshProUGUI[] texts; // 0 메인스탯, 1 현재 스탯
eStat m_MainStat;
public override void Set<T>(T _base)
{
base.Set(_base);
m_MainStat = DSUtil.StringToEnum<eStat>(_base.ToString());
texts[0].text = m_MainStat.ToString();
texts[0].color = texts[1].color = Get_MainStatColor();
Set_Detail();
Set_StatPoint();
}
void Set_Detail()
{
m_PCInfoStatMgrCard_Stats.Set(m_MainStat, Get_StatPoint());
}
int Get_StatPoint()
{
return table_classconfig.Ins.Get_PureStat(m_MainStat, ServerInfo.Ins.m_ServerData) + PCInfoStatMgrUI.Ins.Get_Stat(m_MainStat);
}
void Set_StatPoint()
{
texts[1].text = $"{table_classconfig.Ins.Get_PureStat(m_MainStat, ServerInfo.Ins.m_ServerData)}\n+({PCInfoStatMgrUI.Ins.Get_Stat(m_MainStat)})";
}
Color Get_MainStatColor()
{
var classData = table_classconfig.Ins.Get_Data_orNull(ServerInfo.Ins.m_ServerData.Get_EqiupmentEquip(eItem.PC));
if (m_MainStat == classData.Get_MainStatToStat())
return Color.magenta;
return Color.white;
}
public void OnClick_Stat(int add)
{
PCInfoStatMgrUI.Ins.Set_Stat(m_MainStat, add, Set_Detail);
Set_StatPoint();
}
}