Пример #1
0
    /// <summary>
    /// callback by LoopScrollRect
    /// </summary>
    /// <param name="index"></param>
    /// <param name="tf"></param>
    private void OnRefreshCell(int index, Transform tf)
    {
        if (_data == null || _data.Count < 0)
        {
            //Debug.LogError("loopScrollView data is empty");
            return;
        }
        if (index < 0 || index > _data.Count - 1)
        {
            Debug.LogError("cell index is overflow " + index);
            return;
        }
        UICell cel = tf.GetComponent <UICell>();

        if (cel)
        {
            cel.Init(this);
            cel.SetData(index, _data[index], _curSelectIndex == index);
        }
    }