Exemple #1
0
    public void Dispose()
    {
        for (int i = 0; i < m_itemList.Count; i++)
        {
            ScaleScrollItemBase ssi = m_itemList[i].GetComponent <ScaleScrollItemBase>();
            ssi.Dispose();

            GameObjectManager.DestroyGameObjectByPool(m_itemList[i]);
        }

        m_itemList.Clear();
    }
Exemple #2
0
    public void SetData(string itemName, List <Dictionary <string, object> > dataList)
    {
        for (int i = 0; i < dataList.Count; i++)
        {
            GameObject item = GameObjectManager.CreateGameObjectByPool(itemName, m_rect.gameObject);
            m_itemList.Add(item);

            //设置数据
            ScaleScrollItemBase ssi = item.GetComponent <ScaleScrollItemBase>();
            ssi.Init(i);
            ssi.SetData(dataList[i]);

            //调整位置
            item.transform.localPosition = new Vector3(i * m_itemSpace, 0, 0);
        }
    }