Example #1
0
    private void UpdateActiveQuickSlot()
    {
        Image img = activeQuickSlot.GetComponent <Image>();

        img.color       = unselectedColor;
        activeQuickSlot = quickSlots[activeQuickSlotIndex];
        img             = activeQuickSlot.GetComponent <Image>();
        img.color       = selectedColor;
        //Debug.Log("new Quick slot index = " + activeQuickSlotIndex);
        if (!quickSlots[activeQuickSlotIndex].isUsed)
        {
            //Debug.Log("cant apply selection -> no quick slot set!");
            buildingSystem.SetActiveBlock(-1);
        }
        else
        {
            buildingSystem.SetActiveBlock(activeQuickSlot.item.itemId);
        }
    }