Version: 5.5

説明

OnMouseOver は GUIElement または Collider 上にマウスがあり続ける限り毎フレーム呼び出され続けます

A call to OnMouseEnter occurs on the first frame the mouse is over the object. OnMouseOver is then called each frame until the mouse moves away, at which point OnMouseExit is called.

この関数はレイヤーが「 Ignore Raycast 」のゲームオブジェクトでは呼び出されません。

Physics.queriesHitTriggers が true の場合に限り、この関数は Trigger であると示される Collider 上で呼び出されます。

OnMouseOver can be a co-routine, simply use the yield statement in the function. This event is sent to all scripts attached to the Collider or GUIElement.