Пример #1
0
    public void SwapPickup(PickupSlot pickupSlot)
    {
        Pickup temp = this.pickup;

        this.EquipPickup(pickupSlot.GetPickup());
        pickupSlot.EquipPickup(temp);
    }
Пример #2
0
    public void AddPickup(Pickup pickup)
    {
        //Play a particle effect
        pickupEffect.Play();
        HUD.controller.SendMessage("PickupAcquired", pickup);

        //Before adding pickup to a new slot, check if we already have it equipped somewhere...
        PickupSlot slot = FindSlotWithPickup(pickup);

        if (slot == null)
        {
            //... Otherwise find the best available slot for it to go
            slot = FindBestAvailableSlot();
        }
        if (slot != null)
        {
            slot.EquipPickup(pickup);
        }
        //PulseAllSlots ();
    }