using cfg.ActorCfg; using cfg.VehicleCfg; using Framework; using NLDPB; using System; using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; namespace Gameplay.LegionBattle { /// /// 军团战角色数据 /// public sealed class LegionRoleData { /// /// 角色的id /// public int ID { get; private set; } /// /// 等级 /// public int Level { get; private set; } /// /// 图标 /// public string IconPath { get; private set; } /// /// 类型 /// public ItemType Type { get; private set; } public LegionRoleData(int id) { ID = id; DataItem dataItem = TableManager.Instance.Tables.Item.Get(ID); if (null == dataItem) { DebugUtil.LogError($"(军团战)没有ID为{ID}的角色或载具"); return; } Type = dataItem.Type; switch (Type) { case ItemType.Character: { IconPath = CommonUtils.GetDefaultHeadPathByUid((uint)ID); } break; case ItemType.Vehicle: { DataVehicle dataVehicle = TableManager.Instance.Tables.VehicleConfig.Get(ID); if (null != dataVehicle) Level = dataVehicle.VehicleLevel; IconPath = CommonUtils.GetDefaultVehicleHeadPath((uint)ID); } break; } } public void CopyData(MSG_LB_Character data) { Level = (int)data.Level; } } }