Example #1
0
    void Awake()
    {
        //1. 拿到引用,绑定事件
        contentText = transform.Find("Content").GetComponent <Text>();
        transform.Find("ButtonOk").GetComponent <Button>().onClick.AddListener(ClickOk);
        transform.Find("ButtonCancel").GetComponent <Button>().onClick.AddListener(ClickCancel);

        instance = this;
    }
Example #2
0
 void Awake()
 {
     _instance = this;
     txt       = transform.Find("Text").GetComponent <Text> ();
 }