NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/VehicleCultivate/VehicleDataHelper.cs

39 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using cfg.VihecleCultivateCfg;
using Framework;
public static class VehicleDataHelper
{
public static int GetVehicleSkillId(int vehicleId)
{
VehicleCultivateData vehicleInfo = VehicleCultivateDataManager.Instance.GetVehicleCultivateData((uint)vehicleId);
int skillLv = (int)vehicleInfo.SumBonus(cfg.VihecleCultivateCfg.BonusType.SkillLv);
var skillLevelInfo = TableManager.Instance.Tables.CharacterSkillLevel.Get(vehicleInfo.Cfg.ID, skillLv);
if(skillLevelInfo==null)
{
DebugUtil.LogError("载具id为{0}技能等级为{1}的表没配",vehicleInfo.Cfg.ID,skillLv);
return TableManager.Instance.Tables.CharacterSkillLevel.DataList[0].SkillGroupId;
}
return skillLevelInfo.SkillGroupId;
}
public static BonusType GetBonusTypeByTerrainID(int terrainId)
{
switch (terrainId)
{
case 1:
return BonusType.TerrainPlain;
case 2:
return BonusType.TerrainMountain;
case 4:
return BonusType.TerrainForest;
case 5:
return BonusType.TerrainSnow;
}
DebugUtil.LogError("因为VehicleBonusType暂时不需要其他地形类型,所以妹写");
return BonusType.TerrainPlain;
}
}