(client) feat:添加临时动画组件,添加逃跑逻辑

This commit is contained in:
m0_75251201
2025-09-06 12:25:55 +08:00
parent f43aeffebf
commit 15cdd2b244
73 changed files with 3420 additions and 6055 deletions

View File

@ -30,15 +30,10 @@ namespace Entity
public override void Init(EntityDef entityDef)
{
base.Init(entityDef);
Inventory = new Inventory(this, 3);
// 初始化 currentSelected。
// 使用属性来设置,确保触发事件和范围检查。
// 如果Inventory.Capacity为0则currentSelected会被钳制到0。
// 如果Inventory.Capacity为3currentSelected=0是有效值。
CurrentSelected = 0;
base.Init(entityDef);
}
/// <summary>
@ -59,6 +54,7 @@ namespace Entity
Debug.LogError($"Character '{name}' inventory is not initialized. Cannot pickup item.");
return quantity; // 如果背包未初始化,则视为未能添加任何物品
}
var remainingQuantity = Inventory.AddItem(itemResource, quantity);