Пример #1
0
    //this method is for rendering/filling the inventory grid
    public void RenderInventoryUIGrid(Player_Inventory playerInventoryScript)
    {
        playerInventoryReference = playerInventoryScript;
        string slotName = "";

        for (int i = 0; ((i < playerInventoryReference.getTotalInventoryItemAmount()) && (i < 15)); i++)
        {
            slotName = ("Slot" + i.ToString());
            inventorySlots.transform.Find(slotName).gameObject.GetComponent <Image>().enabled             = true;
            inventorySlots.transform.Find(slotName).gameObject.GetComponent <Button>().enabled            = true;
            inventorySlots.transform.Find(slotName).Find("Text").gameObject.GetComponent <Text>().enabled = true;
            inventorySlots.transform.Find(slotName).Find("Text").gameObject.GetComponent <Text>().text    = playerInventoryReference.getItemNameFromList(i);
        }
    }