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];
|
}
|
}
|