void SetButton(string str) { RemoveCallbacks(); button.gameObject.SetActive(true); output.gameObject.SetActive(false); dropdown.gameObject.SetActive(false); button.GetComponentInChildren <Text>().text = str; button.onClick.AddListener(OnClick); }
void SpawnBreadcrump(HistoryElement historyElement) { GMButton breadcrump = Instantiate(breadcrumpTemplate); breadcrump.transform.SetParent(transform, false); if (!breadcrump.gameObject.activeSelf) { breadcrump.gameObject.SetActive(true); } breadcrump.GetComponentInChildren <Text>().text = historyElement.historyTitle; breadcrump.onClick.AddListener( () => OpenBreadcrump(historyElement) ); breadcrumps.Add(breadcrump, historyElement); }