Example #1
0
    void Awake()
    {
        defaultVec = new Vector3(0, CellHeight, 0); 

        mDrag = NGUITools.FindInParents<CustomScrollView>(gameObject);

        m_height = mDrag.GetComponent<UIPanel>().height;

        m_maxLine = Mathf.CeilToInt(m_height / CellHeight) + 1;

        m_cellList = new WrapItemBase[m_maxLine];
        if (ShowBg)
        {
            m_bgList = new Transform[m_maxLine];
        }
        CreateItem();
        lastY = mDrag.transform.localPosition.y;
    }