This commit is contained in:
CortexCore
2024-03-29 00:58:24 +08:00
parent 967ad8eacf
commit 05315ef4a8
232 changed files with 53368 additions and 8539 deletions

View File

@@ -28,6 +28,12 @@ namespace BITFALL
{
var health = UnityEntity.Get<IHealth>();
health.OnSetAlive += OnSetAlive;
_inventory.AllowUseItemFactory += OnAllowUse;
}
private bool OnAllowUse(IBasicItem arg)
{
return Equipment.Values.Any(x => x.Id == arg?.Id) ;
}
private void OnSetAlive(bool obj)
@@ -75,6 +81,7 @@ namespace BITFALL
OnDeEquip?.Invoke(pair.Key, pair.Value);
_inventory.UseItem(pair.Value);
//自动补齐
if (_inventory.TryGetItem(x => x.AddressablePath == pair.Value.AddressablePath, out var item))
{
Equip(pair.Key, item);