using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using LitJson;
|
|
public class LegendPropertyUtility
|
{
|
|
public static void Init()
|
{
|
}
|
|
public static List<Int2> GetEquipProperties(int itemId)
|
{
|
var config = ItemConfig.Get(itemId);
|
if (config == null)
|
{
|
return null;
|
}
|
|
var legendPropertyConfig = LegendPropertyValueConfig.Get(config.Type, config.LV, config.ItemColor, config.SuiteiD != 0, config.StarLevel);
|
if (legendPropertyConfig == null)
|
{
|
return null;
|
}
|
|
return new List<Int2>(legendPropertyConfig.previewValue);
|
}
|
|
public static List<Int2> GetLegendProFromEquipShen(int itemId)
|
{
|
var shenConfig = EquipShenAttrConfig.Get(itemId);
|
if (shenConfig == null)
|
{
|
return null;
|
}
|
var pro = new Int2[shenConfig.LegendAttrID.Length];
|
for (int i = 0; i < shenConfig.LegendAttrID.Length; i++)
|
{
|
pro[i].x = shenConfig.LegendAttrID[i];
|
pro[i].y = shenConfig.LegendAttrValue[i];
|
}
|
|
return new List<Int2>(pro);
|
}
|
|
public static int GetEquipPropertyCount(int itemId)
|
{
|
var config = ItemConfig.Get(itemId);
|
if (config == null)
|
{
|
return 0;
|
}
|
|
var legendPropertyConfig = LegendPropertyValueConfig.Get(config.Type, config.LV, config.ItemColor, config.SuiteiD != 0, config.StarLevel);
|
if (legendPropertyConfig == null)
|
{
|
return 0;
|
}
|
|
return legendPropertyConfig.propertyCount;
|
}
|
|
}
|