Beispiel #1
0
        private void SelectSlot(Slot slot)
        {
            selectedSlot = slot;

            EntityAction entityAction = slot.LootItem.GetComponent <EntityAction>();

            if (entityAction != null)
            {
                entityAction.OnMoveStart += DeselectOnUse;
                playerMoveController.SelectAction(entityAction);
            }

            if (lootSlots.Contains(slot))
            {
                if (inventorySlots.Count < maxInventorySize)
                {
                    inventorySlots.Add(CreateSlot(inventoryPanel, slotPrefab));
                }
            }
            else if (inventorySlots.Contains(slot))
            {
                lootSlots.Add(CreateSlot(lootPanel, slotPrefab));
            }
        }