update
[linguofeng.github.com.git] / _posts / 2015-01-06-unity3d.textile
blob2fe51630b00aeed558ceb3c6d8eeedc8eacbd344
1 ---
2 layout: post
3 title: Unity3D
4 description: Unity3D 学习系列
5 categories: [archive]
6 tags: [unity3d]
7 ---
9 <section>
10     <p>查找子游戏对象</p>
11 <pre>
12     // 获取按钮并设置点击事件
13     var button = transform.Find("Btn_login").gameObject.GetComponent<Button>();
14     if (button != null) {
15         button.onClick.RemoveAllListeners();
16         button.onClick.AddListener(
17             delegate {
18                 this.onLogin(button);
19             }
20         );
21     }
22 </pre>
23 </section>