Esempio n. 1
0
        protected void Move2Target(float precent)
        {
            switch (layout)
            {
            case Layout.Horizontal:
            {
                precent = Mathf.Max(0, Mathf.Min(1.0f, precent));
                float xV     = precent * (lstCount - 1);
                int   xxv    = Mathf.RoundToInt(xV);
                float target = xxv * m_CellPrecent;
                m_ScrollRect.DoScrollHorizontal(target, 0.25f);
            }
            break;

            case Layout.Vertical:
            {
                precent = Mathf.Max(0, Mathf.Min(1.0f, precent));
                float xV     = precent * (lstCount - 1);
                int   xxv    = Mathf.RoundToInt(xV);
                float target = xxv * m_CellPrecent;
                m_ScrollRect.DoScrollVertical(target, 0.25f);
            }
            break;
            }
        }