Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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); });
    }