Ejemplo n.º 1
0
 public void CreateInventoryDisplay()
 {
     for (int i = 0; i < Inventory.Container.Items.Count; i++)
     {
         InventorySlot slot = Inventory.Container.Items[i];
         {
             var obj = Instantiate(InventoryPrefab, Vector2.zero, Quaternion.identity, transform);
             obj.transform.GetChild(0).GetComponentInChildren <Image>().sprite = slot.item.uiDisplay;
             obj.GetComponent <RectTransform>().localPosition    = Inventory.GetPostition(i, X_Start, Y_Start, Y_Space);
             obj.GetComponentInChildren <TextMeshProUGUI>().text = slot.amount.ToString("n0");
             itemsDisplayed.Add(slot, obj);
         }
     }
     I_Cursor.transform.position = itemsDisplayed[Inventory.Container.Items[0]].transform.position;
 }