public void SelectItem(GameObject p_sender) { if (m_selectedItem != null) { m_selectedItem.Selected = false; } m_selectedItem = p_sender.GetComponent <SelectionListItem>(); m_selectedItem.Selected = true; }
public void AddItemWithoutReposition(String p_data) { GameObject gameObject = NGUITools.AddChild(m_listHolder, m_dataItemPrefab); gameObject.GetComponent <UILabel>().text = p_data; m_dataList.Add(gameObject.GetComponent <SelectionListItem>()); gameObject.GetComponent <UIButtonMessage>().target = this.gameObject; UpdateScrollbar(); if (m_dataList.Count == 1) { m_dataList[0].Selected = true; m_selectedItem = m_dataList[0]; } }