70 lines
1.9 KiB
C#
70 lines
1.9 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// 军团战角色数据
|
|
/// </summary>
|
|
public sealed class LegionRoleData
|
|
{
|
|
/// <summary>
|
|
/// 角色的id
|
|
/// </summary>
|
|
public int ID { get; private set; }
|
|
/// <summary>
|
|
/// 等级
|
|
/// </summary>
|
|
public int Level { get; private set; }
|
|
/// <summary>
|
|
/// 图标
|
|
/// </summary>
|
|
public string IconPath { get; private set; }
|
|
/// <summary>
|
|
/// 类型
|
|
/// </summary>
|
|
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;
|
|
}
|
|
}
|
|
} |