Пример #1
0
    void UpdateTheUI()
    {
        ItemScript zeItem = toKnowTheSlots.allTheSlots[m_slotAt].GetComponentInChildren <ItemScript>();

        // Check whether is there any item script in the slot!
        if (zeItem != null)
        {
            theItemImage.enabled = true;
            theItemText.text     = zeItem.m_itemInform.item_effect;
            theItemImage.sprite  = zeItem.GetComponentInChildren <Image>().sprite;
        }
        else
        {
            theItemText.text = "";
            //theItemImage.sprite = null;
            theItemImage.enabled = false;
        }
        thePosition.SetParent(toKnowTheSlots.allTheSlots[m_slotAt].GetComponent <RectTransform>(), false);
        // We will need to scroll the inventory!
        float zeValue = (float)(m_slotAt) / (float)toKnowTheSlots.allTheSlots.Count;

        theInventoryScrollbar.value = zeValue;
    }