unity3D 在UGUI中動態添加button的監聽事件

unity雖然在UGUI中的inspector面板能夠經過拖動的方式來增長點擊事件,不過若是要監聽的時間太多,拖起來仍是很麻煩的,下面的方法能夠在代碼中動態添加監聽事件。web using UnityEngine; using System.Collections; public class Test : MonoBehaviour{ private Button btn; v
相關文章
相關標籤/搜索