Cambiar al Manual


OnMouseUpAsButton is only called when the mouse is released over the same Collider as it was pressed.

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.