本文主要是记录在学习unity3d中遇到的重点功能的实现,以及一些API的使用方法。以便在之后使用到的时候查找。学习
1,给一个UIButton添加执行的事件this
// Use this for initialization void Start () { //在这里定义一个UIButton UIButton btn = this.transform.Find("btn").GetComponent<UIButton>(); //当前个btn被点击的时候,须要执行一些事件,好比walk(); EventDelegate walk = new EventDelegate(this,"walk"); btn.onClick.Add(walk); } void walk() { } |
更多游戏技术资料请留意游戏技术网,转载注明来自游戏技术网:http://www.youxijishu.comspa