public GameObject table;
public GameObject friend;
public GameObject scrollView;
List<Transform> childList;
public float scrollViewHeight;
float childHeight;
int numberOfChildren;
void Start() {
childHeight = friend.GetComponent<UIWidget>().localSize.y + 5;
childList = table.GetComponent<UITable>().children;
Invoke("Resize", 1f); // temp invoke for testing
}
void Resize() {
numberOfChildren = childList.Count;
scrollViewHeight = childHeight * numberOfChildren;
UIPanel panel = scrollView.GetComponent<UIPanel>();
panel.SetRect(panel.clipOffset.x, panel.clipOffset.y, panel.width, scrollViewHeight);
scrollView.GetComponent<UIScrollView>().ResetPosition();
}