| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public class ItemLegendPropertyUtility |
| | | { |
| | | |
| | | public Dictionary<string, Dictionary<LegendAttrType, int>> legendAttrCntPreviewDict { get; private set; } // key 品质+星级 value 属性条目数 |
| | | public Dictionary<int, Dictionary<LegendAttrType, List<int>>> legendAttrIDPreviewDict { get; private set; } // key 装备位 value 属性类型,属性ID |
| | | public Dictionary<int, Dictionary<int, int>> legendAttrColorValuePreviewDict { get; private set; } // key 属性ID value 装备品质,属性数值 |
| | | public Dictionary<int, Dictionary<int, int>> legendAttrLvValuePreviewDict { get; private set; } // key 属性ID value 装备阶级,属性数值 |
| | | |
| | | public Dictionary<int, int> wingsLegendAttrCntPreviewDict { get; private set; } //key 阶数 value属性数 |
| | | public Dictionary<int, Dictionary<int, List<int>>> wingsLegendAttrValuePreviewDict { get; private set; } //key 阶数 value 属性ID 属性数值 |
| | | public Dictionary<int, Dictionary<LegendAttrType, List<int>>> dogzLegendAttrIDPreviewDict { get; private set; } // key 装备位 value 属性类型,属性ID |
| | | public Dictionary<int, Dictionary<int, int>> dogzLegendAttrColorValuePreviewDict { get; private set; } // key 属性ID value 装备品质,属性数值 |
| | | Dictionary<string, Dictionary<LegendAttrType, int>> dogzLegendAttrCntPreviewDict { get; set; } // key 品质+星级 value 属性条目数 |
| | | Dictionary<int, List<int>> dogzLegendAttrTypeDict { get; set; } |
| | | |
| | | |
| | | public static void Init() |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | public class LegendPropertyColor |
| | | { |
| | | Dictionary<int, LegendAttrType> equipLegendPropertyColors = new Dictionary<int, LegendAttrType>(); |
| | | Dictionary<int, Dictionary<int, string>> wingLegendPropertyColors = new Dictionary<int, Dictionary<int, string>>(); |
| | | |
| | | public LegendPropertyColor(string configId) |
| | | { |
| | | var config = FuncConfigConfig.Get(configId); |
| | | |
| | | var equipColorJsonData = JsonMapper.ToObject(config.Numerical1); |
| | | foreach (var key in equipColorJsonData.Keys) |
| | | { |
| | | var keyToInt = int.Parse(key); |
| | | for (int i = 0; i < equipColorJsonData[key].Count; i++) |
| | | { |
| | | var propertyId = (int)equipColorJsonData[key][i]; |
| | | equipLegendPropertyColors[propertyId] = (LegendAttrType)keyToInt; |
| | | } |
| | | } |
| | | |
| | | var wingColorJsonData = JsonMapper.ToObject(config.Numerical2); |
| | | foreach (var key in wingColorJsonData.Keys) |
| | | { |
| | | var propertyId = int.Parse(key); |
| | | if (!wingLegendPropertyColors.ContainsKey(propertyId)) |
| | | { |
| | | wingLegendPropertyColors[propertyId] = new Dictionary<int, string>(); |
| | | } |
| | | |
| | | var subJson = wingColorJsonData[key]; |
| | | var colors = wingLegendPropertyColors[propertyId]; |
| | | foreach (var key2 in subJson.Keys) |
| | | { |
| | | var limit = int.Parse(key2); |
| | | colors[limit] = subJson[key2][0].ToString(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public LegendAttrType GetPropertyType(int propertyId) |
| | | { |
| | | if (equipLegendPropertyColors.ContainsKey(propertyId)) |
| | | { |
| | | return equipLegendPropertyColors[propertyId]; |
| | | } |
| | | else |
| | | { |
| | | return LegendAttrType.Normal; |
| | | } |
| | | } |
| | | |
| | | public string GetWingPropertyColor(int propertyId, int value) |
| | | { |
| | | if (!wingLegendPropertyColors.ContainsKey(propertyId)) |
| | | { |
| | | return "ffffff"; |
| | | } |
| | | |
| | | var colors = wingLegendPropertyColors[propertyId]; |
| | | var ienumerator = colors.GetEnumerator(); |
| | | var color = ienumerator.Current.Value; |
| | | while (ienumerator.MoveNext()) |
| | | { |
| | | if (value < ienumerator.Current.Key) |
| | | { |
| | | color = ienumerator.Current.Value; |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return color; |
| | | } |
| | | |
| | | } |
| | | |
| | | public class LegendPropertyCount |
| | | { |
| | | Dictionary<> |
| | | |
| | | |
| | | class StarLegendPropertyCount |
| | | { |
| | | Dictionary<LegendAttrType, int> counts = new Dictionary<LegendAttrType, int>(); |
| | | |
| | | public StarLegendPropertyCount(JsonData json) |
| | | { |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |