yyl
2026-03-26 f4a702e212d1853735f8dae399da69d23bfa510e
Main/System/Hero/HeroInfo.Skin.cs
@@ -1,9 +1,10 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public partial class HeroInfo
{
    // 78 # 英雄使用的皮肤索引
    // 78 # 英雄使用的皮肤索引 (形象)
    public int SkinIndex
    {
        get
@@ -25,12 +26,59 @@
    //  皮肤配置
    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];
    }
}