标签:
在官网的api文档中仅说明了
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()五个函数,其它的还是有效的)。
unity中的MonoBehaviour.OnMouseDown()
标签:
原文地址:http://www.cnblogs.com/bhlsheji/p/5133245.html