Exemple #1
0
    public void PickUpLootBag()
    {
        const float pickupRange = 1.0f;

        // Find the loot object
        if (droppedLootBag == null)
        {
            // The object hasnt been dropped at all
            return;
        }

        float distance = (droppedLootBag.transform.position - transform.position).magnitude;

        if (distance > pickupRange)
        {
            return;
        }

        // The bag is in range and available, so consume the object
        droppedLootBag.PickedUpBy(this);
        lootBagSprite.enabled = true;
        bCarryingLootBag      = true;

        droppedLootBag = null;

        UPDATE_BINDING("LootBagHeld", true);
    }