public static NoticePop Instance() { if (!noticePop) { noticePop = FindObjectOfType(typeof(NoticePop)) as NoticePop; if (!noticePop) { Debug.LogWarning("There needs to be one active NoticePop script on a GameObject in your scene."); } } return(noticePop); }
void Populate(Notice notice) { newObj = (GameObject)Instantiate(prefab, noticeContent.transform); newObj.name = notice.GetHashCode().ToString(); // Notice Title 출력 //var texts = newObj.GetComponents<Text>(); //var text = newObj.GetComponent<Text>(); //text.text = notice.Title; // 접속 버튼 Button button = newObj.GetComponentInChildren <Button>(); button.GetComponentInChildren <Text>().text = notice.Title; button.onClick.AddListener(delegate { NoticePop.Instance().SetNotice(notice); }); }