1
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user