void Awake() { _instance = this; _content = transform.Find("content/Text").GetComponent <UILabel>(); _okLabel = transform.Find("okBtn/Text").GetComponent <UILabel>(); _cancelLabel = transform.Find("cancelBtn/Text").GetComponent <UILabel>(); transform.Find("okBtn").GetComponent <Button>().onClick.AddListener(OKClick); transform.Find("cancelBtn").GetComponent <Button>().onClick.AddListener(CancelClick); SetActive(this.gameObject, false); }
public void Destory() { _instance = null; GameObject.DestroyImmediate(this.gameObject); }