Пример #1
0
    public void SetItems(IEnumerable items)
    {
        storeCells.Clear();
        int num = 0;

        foreach (Item childItem in items)
        {
            if (!StoreManager.IsItemPrice(childItem.GetID()))
            {
                continue;
            }
            Vector3    pos      = new Vector3(transform.position.x, transform.position.y - (num + 0.5f) * Height, 0);
            GameObject instance = Instantiate(content, pos, transform.rotation, transform);
            instance.SetActive(true);
            StoreCell cell = instance.GetComponent <StoreCell>();
            cell.SetItem(childItem);
            storeCells.Add(cell);
            num += 1;
        }
    }