Beispiel #1
0
    /// <summary>
    /// 显示Cell
    /// </summary>
    /// <param name="index"></param>
    /// <param name="isRebuild"></param>
    /// <param name="data"></param>
    void ShowCell(int index, bool isRebuild)
    {
        ScrollPageViewCell cellTmp = GetCell();

        cellTmp.transform.SetParent(content);
        cellTmp.transform.localScale             = Vector3.one;
        cellTmp.RectTransform.anchoredPosition3D = GetCellPos(index);

        if (!isRebuild)
        {
            cellTmp._index = index;
            cellTmp.gameObject.SetActive(true);
            cellTmp.Show();

            if (_onRefresh != null)
            {
                _onRefresh(index, cellTmp);
            }
        }

        _cells.Add(cellTmp);
    }