protected void Rebuild()
{
if (isValid)
{
textLabel.UpdateNGUIText();
NGUIText.rectHeight = 1000000;
mTotalLines = 0;
for (int i = 0; i < mParagraphs.size; i++)
{
Paragraph paragraph = mParagraphs.buffer[i];
NGUIText.WrapText(paragraph.text, out string finalText);
paragraph.lines = finalText.Split('\n');
mTotalLines += paragraph.lines.Length;
}
mTotalLines = 0;
int j = 0;
for (int size = mParagraphs.size; j < size; j++)
{
mTotalLines += mParagraphs.buffer[j].lines.Length;
}
if (scrollBar != null)
{
UIScrollBar uIScrollBar = scrollBar as UIScrollBar;
if (uIScrollBar != null)
{
uIScrollBar.barSize = ((mTotalLines != 0) ? (1f - (float)scrollHeight / (float)mTotalLines) : 1f);
}
}
UpdateVisibleText();
}
}