public bool ReceiveItem(StealableObject item) { if (item == null) { return(false); } Game.UI.IncreaseMoney(item.Earnings); return(true); }
private void DeliverObject() { // Player is not carrying anything, no need to do anything. if (_carryingObject == null) { return; } var deliverySystem = FindComponentInRange <DeliverySystem>(); if (deliverySystem.ReceiveItem(_carryingObject)) { _carryingObject = null; } CarryingObject.SetActive(false); }
private void StealObjects() { // If the player is carrying an object, they should not be able to pick // up another object. if (_carryingObject != null) { return; } var stealableObject = FindComponentInRange <StealableObject>(); // No object found, return. if (stealableObject == null) { return; } stealableObject.StealObject(); _carryingObject = stealableObject; CarryingObject.SetActive(true); }