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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using System;
using System.Collections.Generic;
using UnityEngine;
 
public partial class HeroInfo
{
    // 78 # 英雄使用的皮肤索引 (形象)
    public int SkinIndex
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(78);
        }
    }
    //  服务器数据 皮肤ID
    public int SkinID
    {
        get
        {
 
            return heroConfig.SkinIDList[SkinIndex];
        }
    }
 
    //  皮肤配置
    public HeroSkinConfig skinConfig
    {
        get
        {
            return HeroSkinConfig.Get(SkinID);
        }
    }
 
    //属性生效的皮肤索引
    public int SkinAttrIndex
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(82);
        }
    }
 
    public int SkinAttrID
    {
        get
        {
            return heroConfig.SkinIDList[SkinAttrIndex];
        }
    }
 
 
    public int GetHeroSkinValue(int attrType)
    {
        var cfg = HeroSkinAttrConfig.Get(SkinAttrID);
        if (cfg == null)
            return 0;
        var index = Array.IndexOf(cfg.WearAttrIDList, attrType);
        if (index == -1)
            return 0;
        return cfg.WearAttrValueList[index];
    }
 
    public int GetHeroSkinPer(int attrType)
    {
        var cfg = HeroSkinAttrConfig.Get(SkinAttrID);
        if (cfg == null)
            return 0;
            
        var _type = 0;
        if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
        {
            _type = PlayerPropertyConfig.baseAttr2perDict[attrType];
        }
        
        var index = Array.IndexOf(cfg.WearAttrIDList, _type);
        if (index == -1)
            return 0;
        return cfg.WearAttrValueList[index];
    }
}