private UINewsEntry InstantiateScreenEntry() { UINewsEntry newScreenEntry = GameObject.Instantiate <UINewsEntry>(m_NewsEntryPrefab, m_NewsWindowLG.transform); Debug.Assert(newScreenEntry != null, "UINewsEntry.InstantiateScreenEntry - Failed to instantiate UINewsEntry, ensure that the prefab is valid and that the layout group is not null."); return(newScreenEntry); }
public void AddNewNewsEntry(string entry) { UINewsEntry popedEntry = m_NewsEntryList.Push_Front(InstantiateScreenEntry()); m_NewsEntryList.Front().SetData(entry); if (popedEntry != null) { GameObject.Destroy(popedEntry.gameObject); } }