示例#1
0
    // Add items in a row
    public void AddItems(int startIdx, int endIdx)
    {
        // Load from itemList in UIManager
        for (int i = startIdx; i <= endIdx; i++)
        {
            Shoe       item      = UIManager.Instance.itemList[i];
            GameObject newButton = UIManager.Instance.itemObjPool.GetObject();
            newButton.transform.SetParent(selfTransform, false);
            SampleItem sampleButton = newButton.GetComponent <SampleItem>();

            // Initialize informations of each shoe button
            sampleButton.Setup(item);
        }
    }