示例#1
0
    List <ShopSlot> CreateSlots(Transform parent)
    {
        List <ShopItem> items = CreateItems();
        List <ShopSlot> slots = new List <ShopSlot>(items.Count);

        for (int i = 0; i < items.Count; i++)
        {
            GameObject sItem = Instantiate(itemSlot, parent);
            ShopSlot   slot  = ShopSlot.CreateComponent(sItem, items[i]);
            slot.Button.onClick.AddListener(() => { ValidateStorage(slot); });
            slots.Add(slot);
        }
        return(slots);
    }