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

46 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PCInfoStatmgrCard_Stats_Data
{
public eStat Stat;
public double val;
}
public class PCInfoStatMgrCard_Stats : uScrollViewMgr
{
List<PCInfoStatmgrCard_Stats_Data> list = new List<PCInfoStatmgrCard_Stats_Data>();
public void Set(eStat stat, int val)
{
list.Clear();
Dictionary<eStat, float> dic = null;
switch (stat)
{
case eStat.STR: dic = MyValue.dic_MainStatMultiplier[eMainStatType.STR]; break;
case eStat.DEX: dic = MyValue.dic_MainStatMultiplier[eMainStatType.DEX]; break;
case eStat.INT: dic = MyValue.dic_MainStatMultiplier[eMainStatType.INT]; break;
case eStat.LUK: dic = MyValue.dic_MainStatMultiplier[eMainStatType.LUCK]; break;
}
int statCount = 3;
var classData = table_classconfig.Ins.Get_Data_orNull(ServerInfo.Ins.m_ServerData.Get_EqiupmentEquip(eItem.PC));
foreach (var item in dic)
{
if (item.Key == eStat.ATK)
{
if (classData.Get_MainStatToStat() != stat)
continue;
}
list.Add(new PCInfoStatmgrCard_Stats_Data { Stat = item.Key, val = val * dic[item.Key] });
--statCount;
if (statCount == 0)
break;
}
Set_ScrollView(list);
}
}