102 lines
2.6 KiB
C#
102 lines
2.6 KiB
C#
using cfg.VehicleCfg;
|
|
using Framework;
|
|
namespace Gameplay.Vehicle.Data
|
|
{
|
|
public class VehicleConfigData
|
|
{
|
|
|
|
public int configId;
|
|
|
|
public int level;
|
|
|
|
public int attack;
|
|
public int defense;
|
|
|
|
public int hp;
|
|
public int shield;
|
|
|
|
public float moveSpeed;
|
|
public float turnSpeed;
|
|
|
|
public int attackDistance;
|
|
|
|
public int standLevel;
|
|
public int crossLevel;
|
|
|
|
public float batteryTurnSpeed;
|
|
|
|
public float shootCd;
|
|
|
|
public int maxBulletCount;
|
|
public int perShootCount;
|
|
public float reloadTime;
|
|
|
|
public int moraleAttack;
|
|
public float scaleForHuman;
|
|
public float scaleForVehicle;
|
|
|
|
public float criticalRate;
|
|
public float criticalDamageScale;
|
|
|
|
public float firstShootTime;
|
|
|
|
public int weaponId;
|
|
|
|
public int sitCount;
|
|
|
|
public string PrefabPath;
|
|
|
|
public int tireMarkId;
|
|
|
|
public int skillId;
|
|
|
|
public void Init(DataVehicle rawConfig,
|
|
int level, int skillLevel)
|
|
{
|
|
configId = rawConfig.ID;
|
|
PrefabPath = rawConfig.PrefabPath;
|
|
|
|
this.level = level;
|
|
|
|
var levelIndex = level - 1;
|
|
attack = rawConfig.Damages[levelIndex];
|
|
defense = rawConfig.Defenses[levelIndex];
|
|
hp = rawConfig.Hps[levelIndex];
|
|
shield = rawConfig.Shields[levelIndex];
|
|
|
|
moveSpeed = rawConfig.MoveSpeed;
|
|
turnSpeed = rawConfig.TurnSpeed;
|
|
|
|
crossLevel = rawConfig.MoveCrossLevel;
|
|
standLevel = rawConfig.StandCrossLevel;
|
|
|
|
attackDistance = rawConfig.AttackDistance;
|
|
|
|
batteryTurnSpeed = rawConfig.BatteryTurnSpeed;
|
|
shootCd = 1f / rawConfig.FireRate;
|
|
|
|
maxBulletCount = rawConfig.BulletCount;
|
|
perShootCount = rawConfig.PerShootCount;
|
|
reloadTime = rawConfig.ReloadTime;
|
|
|
|
moraleAttack = rawConfig.MoraleDamage;
|
|
criticalRate = rawConfig.CriticalRate;
|
|
criticalDamageScale = rawConfig.CriticalScale;
|
|
|
|
firstShootTime = rawConfig.FirstShootTime;
|
|
|
|
sitCount = rawConfig.SeatCount;
|
|
|
|
weaponId = rawConfig.WeaponId;
|
|
|
|
tireMarkId = rawConfig.TireMarkId;
|
|
|
|
var skillConfig = TableManager.Instance.Tables.VehicleSkllUpgrade.Get(rawConfig.ID);
|
|
var skillLevelIndex = skillLevel - 1;
|
|
skillId = skillConfig.SkillIdList[skillLevelIndex];
|
|
|
|
}
|
|
|
|
}
|
|
}
|