Exemplo n.º 1
0
    protected override bool PreCheck()
    {
        // Has the item a value?
        if (itemToPickUp.TryGetValue(out item) == false)
        {
            return(false);
        }

        // Is the item to far away?
        if ((toy.transform.position - item.transform.position).sqrMagnitude >
            ConstantsDict.Instance.SquaredDistanceItemPickupRange)
        {
            return(false);
        }

        // is the item heavier than the left inventory capcity?
        if (toy.Inventory.CapacityLeft < item.item.SingleWeight)
        {
            return(false);
        }

        return(true); // everything should be fine
    }