为什么我的button点击没反应
GComponent mainUI;
GObject bt;
// Use this for initialization
void Start () {
mainUI = gameObject.GetComponent<UIPanel>().ui;
bt = mainUI.GetChild("n9");
bt.onClick.Add(ChangeScene);
}
// Update is called once per frame
void Update () {
}
void ChangeScene() {
Debug.Log("<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>");
}
GObject bt;
// Use this for initialization
void Start () {
mainUI = gameObject.GetComponent<UIPanel>().ui;
bt = mainUI.GetChild("n9");
bt.onClick.Add(ChangeScene);
}
// Update is called once per frame
void Update () {
}
void ChangeScene() {
Debug.Log("<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>");
}
没有找到相关结果
已邀请:
2 个回复
洛青逸
赞同来自:
洛青逸
赞同来自: