unity ngui中出现问题Failed to call function OnClick of class...

w83223772022-10-04 11:39:541条回答

unity ngui中出现问题Failed to call function OnClick of class...
场景中的某个物体如下:




代码内容如下:

在运行的时候点击该物体出现错误:
Failed to call function OnClick of class DogHeadSHake
Calling function OnClick with no parameters but the function requires 1.
UnityEngine.GameObject:SendMessage(String,Object,SendMessageOptions)
UICamera:Notify(GameObject,String,Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:794)
UICamera:ProcessTouch(Boolean,Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1463)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1092)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1162)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:939)


请问这是怎么回事,该怎么解决?
物体中的碰撞体忘了勾IsTrigger,勾上以后同样还是有问题的.

已提交,审核后显示!提交回复

共1条回复
wang699kun 共回答了17个问题 | 采纳率94.1%
Calling function OnClick with no parameters but the function requires 1.
调用的OnClick函数没有参数列表,但实际上的OnClick函数却带有一个参数.
1年前

相关推荐