我想在一个脚本里监听两个 NGUI的按钮
自己写了一段代码 ,但是这样会出错 求修改
void Awake(){ GameObject jumpbutton = GameObject.Find("UI Root/jump");
GameObject crouchbutton = GameObject.Find("UI Root/crouch");
UIEventListener.Get (jumpbutton).onPress += new UIEventListener.BoolDelegate(Jumpbutton);
UIEventListener.Get (crouchbutton).onPress +=new UIEventListener.BoolDelegate(Button);
}
自己写了一段代码 ,但是这样会出错 求修改
void Awake(){ GameObject jumpbutton = GameObject.Find("UI Root/jump");
GameObject crouchbutton = GameObject.Find("UI Root/crouch");
UIEventListener.Get (jumpbutton).onPress += new UIEventListener.BoolDelegate(Jumpbutton);
UIEventListener.Get (crouchbutton).onPress +=new UIEventListener.BoolDelegate(Button);
}
