public void OnSelectDecoration(int selectID) { if (selectID == 0) { decoration = null; } else { decoration = new Decoration(dropdown.options[selectID].text); } RefreshUI(); }
public DecorationItem(DecorationUI ui, Decoration decoration) { this.decoration = decoration; item = GameObject.Instantiate(ui.scrollItem.gameObject); item.transform.SetParent(ui.scrollItem.parent); item.gameObject.SetActive(true); item.transform.Find("Text").GetComponent <Text>().text = decoration.title; item.transform.Find("Minus").GetComponent <Button>().onClick.AddListener( delegate() { ui.OnMinus(this); GameObject.Destroy(item); } ); }