private void ScrollToBottom()
        {
            if (!autoScrollToBottom)
            {
                return;
            }

            if (m_shouldScrollToBottom)
            {
                UGUIUtil.ScrollToBottom(scrollRect);
                m_shouldScrollToBottom = false;
            }
        }
        private void Refresh()
        {
            float beginY           = rectTransform.anchoredPosition.y;
            float scrollRectHeight = UGUIUtil.GetRect(scrollRect.transform).height;
            float rowHeight        = GetRowHeight();

            // Calculate which items should be visible. [beginItemIndex, endItemIndex)
            float f_beginItemIndex = beginY / rowHeight - EXTRA_ROW_COUNT;
            float f_endItemIndex   = (beginY + scrollRectHeight) / rowHeight + EXTRA_ROW_COUNT;

            int beginItemIndex = Mathf.FloorToInt(f_beginItemIndex);
            int endItemIndex   = Mathf.CeilToInt(f_endItemIndex);

            if (beginItemIndex < 0)
            {
                beginItemIndex = 0;
            }
            if (endItemIndex > m_items.Count)
            {
                endItemIndex = m_items.Count;
            }

            bool layout = false;

            if (m_rowContainer.ProcessVisibleItemsNotInRange(beginItemIndex, endItemIndex))
            {
                layout |= true;
            }

            if (m_rowContainer.ProcessInvisibleItemsInRange(beginItemIndex, endItemIndex))
            {
                layout |= true;
            }

            if (m_rowContainer.VisibleRowCount != m_visibleRowCount)
            {
                layout |= true;
            }

            if (layout)
            {
                LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
            }

            m_visibleRowCount = m_rowContainer.VisibleRowCount;
        }
Esempio n. 3
0
 private void SetStackTraceMsg(LogEntry log)
 {
     uiStackTrace.text = CreateStackTraceMsg(log);
     UGUIUtil.ScrollToLeftTop(stackTraceScrollRect);
 }