52 lines
1.8 KiB
C#
52 lines
1.8 KiB
C#
using Gameplay.Common;
|
|
using Gameplay.Emoji;
|
|
using Gameplay.Unit;
|
|
using Gameplay.Unit.Data;
|
|
using Gameplay.Utils;
|
|
using Gameplay.Weapon;
|
|
|
|
namespace Gameplay.Character
|
|
{
|
|
public partial class Character : GameUnit
|
|
{
|
|
public int ConfigId;
|
|
public CharacterRuntimeData runtimeData;
|
|
public CharacterAnim cAnim;
|
|
public ViewWeapon weapon;
|
|
|
|
public int troopId {
|
|
get
|
|
{
|
|
return commonData.troopId;
|
|
}
|
|
}
|
|
|
|
public Character(uint id, CharacterConfigData configData, int troopId) : base(id, troopId, EGameUnitType.Character)
|
|
{
|
|
ConfigId = configData.cfgId;
|
|
debugShowInfo = configData.debugShowInfo;
|
|
commonData.level = configData.level;
|
|
avatarType = EAvatarType.Human;
|
|
configData.modelPath = PathEx.GetCharacterFightModelPath(configData.nameId);
|
|
// 重新拼接加载路径 Assets/Art/AutoGen/Characters/character_A00001/character_A00001.prefab
|
|
// configData.modelPath = $"Assets/Art/AutoGen/Characters/character_{configData.nameId}/character_{configData.nameId}.prefab";
|
|
|
|
runtimeData = new CharacterRuntimeData(this);
|
|
runtimeData.configData = configData;
|
|
runtimeData.Init();
|
|
|
|
commonData.canControl = troopId == ETroopsId.Self;
|
|
commonData.crossLevel = configData.crossLevel;
|
|
commonData.standLevel = configData.standLevel;
|
|
commonData.eJob = configData.job;
|
|
}
|
|
|
|
public override string GetDescString()
|
|
{
|
|
var selfStr = commonData.troopId == ETroopsId.Self ? "己方" : "敌方";
|
|
return $"{selfStr}角色{runtimeData.configData.nameId}";
|
|
// return base.GetDescString();
|
|
}
|
|
|
|
}
|
|
} |