public void RefreshStampButtons() { foreach (GameObject template_button in template_buttons) { Object.Destroy(template_button); } template_buttons.Clear(); base_template_assets = TemplateCache.CollectBaseTemplateNames("bases"); base_template_assets.AddRange(TemplateCache.CollectBaseTemplateNames("poi")); base_template_assets.AddRange(TemplateCache.CollectBaseTemplateNames(string.Empty)); foreach (string base_template_asset in base_template_assets) { GameObject gameObject = Util.KInstantiateUI(prefab_paste_button, button_list_container, true); KButton component = gameObject.GetComponent <KButton>(); string template_name = base_template_asset; component.onClick += delegate { OnClickPasteButton(template_name); }; LocText componentInChildren = gameObject.GetComponentInChildren <LocText>(); componentInChildren.text = template_name; template_buttons.Add(gameObject); } }