Version: 5.4

Descripción

Llamado cada frame mientras que el mouse está sobre el GUIElement o 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.

Esta función no es llamada en objetos que pertenezcan a la layer (capa) Ignore Raycast.

Esta función se llama en los Colliders marcados como Trigger si y solo sí Physics.queriesHitTriggers es true.

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.