Beispiel #1
0
        void Start()
        {
            _dataBase = GetComponent<ItemDataBase>();

            slotAmount = 20;
            //inventoryPanel = GameObject.Find("Inventory Panel");
            slotPanel = inventoryPanel.transform.FindChild("Slot Panel").gameObject;
            for (int i = 0; i < slotAmount; i++)
            {
                items.Add(new Item());
                slots.Add(Instantiate(inventorySlot));
                slots[i].GetComponent<Slot>().id = i;
                slots[i].transform.SetParent(slotPanel.transform);
            }
            AddItem(2);
            AddItem(0);
            AddItem(0);
            AddItem(0);
            AddItem(1);
            AddItem(2);
        }
Beispiel #2
0
        void Start()
        {
            _dataBase = GetComponent <ItemDataBase>();

            slotAmount = 20;
            //inventoryPanel = GameObject.Find("Inventory Panel");
            slotPanel = inventoryPanel.transform.FindChild("Slot Panel").gameObject;
            for (int i = 0; i < slotAmount; i++)
            {
                items.Add(new Item());
                slots.Add(Instantiate(inventorySlot));
                slots[i].GetComponent <Slot>().id = i;
                slots[i].transform.SetParent(slotPanel.transform);
            }
            AddItem(2);
            AddItem(0);
            AddItem(0);
            AddItem(0);
            AddItem(1);
            AddItem(2);
        }