少年修仙传客户端代码仓库
hch
2025-07-24 50e53441950268933694eeb5aad36147bbe1014d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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;
    }
 
}