MonoBehaviour.OnMouseUpAsButton()

Switch to Manual

Description

松开鼠标时,仅当鼠标在按下时所在的 GUIElementCollider 上时,才调用 OnMouseUpAsButton。

另请参阅:OnMouseUp

using UnityEngine;
using System.Collections;

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

在属于 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.