在官网的api文档中仅说明了
Description
OnMouseDown is called when the user has pressed the mouse button while over theGUIElement orCollider.
经过我的试验,B是A子物体,如果A和B都有collider,点击谁就执行谁脚本的OnMouseDown()。
而且只能点到最外的物体,比如A和B是两个独立的物体,A把B遮到了,就只能点到A。B是不会执行的。
(说个话外题:禁用脚本只是禁用了awake(),start(),update(),fixedupdate(),ongui()五个函数,其他的还是有效的)。