public bool TryWithdrawItem(IDepositable depositableToWithdraw, Vector3?withdrawPosition) { depositableToWithdraw.Withdraw(); DepositedItems.Remove(depositableToWithdraw); var grabbable = depositableToWithdraw as BaseGrabbable; grabbable.Rigidbody.isKinematic = false; RemoveFoodItem(depositableToWithdraw); return(true); }
public bool TryWithdrawItem(IDepositable depositableToWithdraw, Vector3?withdrawPosition) { if (depositableToWithdraw == null) { return(false); } var grabbable = depositableToWithdraw as IGrabbable; var containerSlot = GetGrabbableSlot(grabbable); depositableToWithdraw.Withdraw(); DepositedItems.Remove(depositableToWithdraw); grabbable.Rigidbody.isKinematic = true; grabbable.Transform.position = containerSlot.Transform.position; grabbable.Transform.SetParent(containerSlot.Transform); containerSlot.IsEmpty = true; return(true); }