我是Unity的新手,我正在做一些教程,但是一个让我抓狂.我有一个带有盒子对撞机的旋转立方体.除OnMouseDown()外,所有事件都有效.我不知道是什么问题......这是一段代码.
void onMouseDown() {
Debug.Log ("On Mouse Down Event!!!!!!!!!");
}
void OnMouseUp() {
Debug.Log("On Mouse Up Event");
}
void OnMouseOver() {
Debug.Log("On Mouse Over Event");
}
void OnMouseEnter() {
Debug.Log("On Mouse Enter Event");
}
void OnMouseDrag() {
Debug.Log("On Mouse Drag Event");
}
Run Code Online (Sandbox Code Playgroud)
在控制台中,显示消息"On Mouse Down Event !!!!!!!!!" 对我在立方体上的大量点击并不重要.
有没有办法在构建之前自动运行脚本方法File > Build Settings... > Build?
我知道我可以创建一个菜单项来调用我的方法并在之后调用构建.