예제 #1
0
    public bool ReceiveItem(StealableObject item)
    {
        if (item == null)
        {
            return(false);
        }

        Game.UI.IncreaseMoney(item.Earnings);
        return(true);
    }
예제 #2
0
    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);
    }
예제 #3
0
    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);
    }