MonoBehaviour.OnMouseUpAsButton()

Cambiar al Manual

Descripción

OnMouseUpAsButton es solamente llamado cuando el mouse se suelta sobre el mismo GUIElement o Collider a medida que era presionado.

See Also: OnMouseUp.

// Loads the level named "SomeLevel" as a response
// to the user clicking on the object

using UnityEngine;

public class ExampleClass : MonoBehaviour { void OnMouseUpAsButton() { Application.LoadLevel("SomeLevel"); } }

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

This function is called on Colliders marked as Trigger if and only if Physics.queriesHitTriggers is true.

OnMouseUpAsButton 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.