(client) chore

This commit is contained in:
m0_75251201
2025-08-26 16:00:58 +08:00
parent efbf4f824a
commit f04c89046b
51 changed files with 2390 additions and 617 deletions

View File

@ -7,7 +7,6 @@ using Base;
using Data;
using Prefab;
using UnityEngine;
using UnityEngine.Serialization;
namespace Entity
@ -29,7 +28,9 @@ namespace Entity
public ProgressBarPrefab healthBarPrefab;
public VisionRangeDetector visionRangeDetector;
public EntityPrefab entityPrefab;
public EntityDef entityDef;
/// <summary>
/// 人工智能行为树,定义实体的行为逻辑。
/// </summary>
@ -43,8 +44,7 @@ namespace Entity
/// <summary>
/// 实体的属性定义,包括生命值、攻击力、防御力等。
/// </summary>
public AttributesDef attributes = new();
public Attributes attributes=new();
/// <summary>
/// 实体当前的移动方向。
/// </summary>
@ -69,7 +69,8 @@ namespace Entity
/// 表示实体是否处于追逐状态(影响移动速度)。
/// </summary>
public bool IsChase { set; get; } = true;
public string currentDimensionId = null;
@ -149,7 +150,6 @@ namespace Entity
// 协程引用
private Coroutine _attackCoroutine;
protected EntityDef entityDef;
[SerializeField] private float _hitBarUIShowTime = 5;
@ -163,7 +163,7 @@ namespace Entity
/// <param name="entityDef">实体的定义数据。</param>
public virtual void Init(EntityDef entityDef)
{
attributes = entityDef.attributes.Clone();
attributes = new Attributes(entityDef.attributes);
aiTree = Utils.BehaviorTree.ConvertToAIBase(entityDef.behaviorTree);
affiliation = entityDef.affiliation?.defName;
InitBody(entityDef.drawingOrder);
@ -227,7 +227,7 @@ namespace Entity
var animators = targetObj.GetComponentsInChildren<SpriteAnimator>();
if (animators.Length > 0)
{
animatorsForOrientation.AddRange(animators.Cast<ITick>());
animatorsForOrientation.AddRange(animators);
}
stateAnimNodes[orientation] = animatorsForOrientation;
}