public override void OnUseItem(InventorySlotBehaviour inventorySlotBehaviour) { if (_healthBehaviour.Value < _healthBehaviour.MaxHealth) { _isUsed = true; _healthBehaviour.Value += IncreaseValue; AudioManager.Play(healthSFX, AudioCategory.Effect); inventorySlotBehaviour.PlayAnimation("InventorySlotBounceExpand"); inventorySlotBehaviour.DropItem(); Destroy(gameObject); } }
public override void OnUseItem(InventorySlotBehaviour inventorySlotBehaviour) { if (_playerHealthBehaviour.Value < _playerHealthBehaviour.MaxHealth) { _isUsed = true; _playerHealthBehaviour.Value += IncreaseValue; AudioManager.Play(healthSFX, AudioCategory.Effect, 1.0f); inventorySlotBehaviour.PlayAnimation("InventorySlotBounceExpand"); inventorySlotBehaviour.DropItem(); // emit health event so tutorial room unlocks EventManager.Emit(new HealthChangedEventArgs { GameObject = gameObject, OldValue = 0, NewValue = 0, }); Destroy(gameObject); } }