I’ve follow Unity lesson which focused scrollist made by scrollrect and panel component and which uses buttons as content. However, how I can add new delegates on top of list ?
GameObject newDelegate = Instantiate(rduCloseButton) as GameObject;
rduDelegate rdelegate = newDelegate.GetComponent<rduDelegate>();
var src = reporta.m_issuedTime.ToString(format);
rdelegate.m_timeLabel.text = src;
rdelegate.m_reportTitle.text = reporta.m_title;
if (contentPanel != null) {
newDelegate.transform.SetParent(contentPanel, false);
}
This will add new delegates (aka buttons) to end of list.
.