void InitializeRows(HierarchyProperty property, int firstRow, int lastRow)
{
property.Reset();
int[] expanded = expandedIDs.ToArray();
// Skip items if needed
if (firstRow > 0)
{
int numRowsToSkip = firstRow;
if (!property.Skip(numRowsToSkip, expanded))
{
Debug.LogError("Failed to skip " + numRowsToSkip);
}
}
// Fetch visible items
int row = firstRow;
while (property.Next(expanded) && row <= lastRow)
{
var item = EnsureCreatedItem(row);
InitTreeViewItem(item, property, property.hasChildren, property.depth);
row++;
}
}