저는 Unity에 익숙하지 않습니다. 자습서를 몇 권하고 있지만, 저를 미치게했습니다. 상자에 충돌자가있는 회전 큐브가 있습니다. 모든 이벤트는 OnMouseDown()을 제외하고 작동합니다. 나는 무엇이 문제인지 모르겠다 ... 여기에 코드 스 니펫이있다.OnMouseDown() 이벤트 관련 문제 Unity
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");
}
콘솔에서 "On Mouse Down Event !!!!!!!!!"메시지가 표시됩니다. 큐브에서 엄청나게 많은 클릭 수는 중요하지 않습니다.
당신은'OnMouseDown'에서'o'를 대문자로 쓰는 것을 잊었습니다. 위키의 강조 표시조차도 그것을 포기합니다 : P – Serdalis
더 많은 관련 정보 : http://answers.unity3d.com/questions/716227/onmouse-event-handlers- might-impact-performance-mo.html – cregox