private void Start() { foreach (HelpPanel.Help help in helpPanel.helpList) { UnityEngine.UI.Button newButton = Instantiate(buttonPrefab, listParent); Text text = newButton.GetComponentInChildren <Text>(); text.text = help.title; newButton.onClick.AddListener(() => { helpPanel.SetupHelpPanel(help.type, () => gameObject.SetActive(true)); gameObject.SetActive(false); }); } }