示例#1
0
    void Start()
    {
        ItemList.Add(EmptyItemSlot1);
        ItemList.Add(EmptyItemSlot2);
        ItemList.Add(EmptyItemSlot3);
        ItemList.Add(EmptyItemSlot4);
        ItemList.Add(EmptyItemSlot5);
        ItemList.Add(EmptyItemSlot6);
        ItemList.Add(EmptyItemSlot7);
        ItemList.Add(EmptyItemSlot8);
        GoldLabel.text = " " + _parentUnit.Gold;

        foreach (GameObject item in ItemList)
        {
            if (item.name == _inventoryDictionary[1])
            {
                PositionList.Add(item.transform.position);
                slot = item.GetComponent <Item>();
                ItemLogicList.Add(slot);
                slot.EmptySlot = true;
            }
            else
            {
                PositionList.Add(item.transform.position);
                slot = item.GetComponent <Item>();
                ItemLogicList.Add(slot);
                slot.EmptySlot = false;
            }
        }
    }
示例#2
0
    void Start()
    {
        GoldLabel.text = "" + _parentUnit.Gold;
        ItemList.Add(EmptyItemSlot1);
        ItemList.Add(EmptyItemSlot2);
        ItemList.Add(EmptyItemSlot3);
        ItemList.Add(EmptyItemSlot4);

        foreach (GameObject item in ItemList)
        {
            PositionList.Add(item.transform.position);
            slot = item.GetComponent <Item>();
            ItemLogicList.Add(slot);
            slot.EmptySlot = true;
        }
    }