MonoBehaviour
- Awake
- CancelInvoke
- FixedUpdate
- InvokeRepeating
- Invoke
- IsInvoking
- LateUpdate
- OnApplicationFocus
- OnApplicationPause
- OnApplicationQuit
- OnBecameInvisible
- OnBecameVisible
- OnCollisionEnter
- OnCollisionExit
- OnCollisionStay
- OnConnectedToServer
- OnControllerColliderHit
- OnDestroy
- OnDisable
- OnDisconnectedFromServer
- OnDrawGizmosSelected
- OnDrawGizmos
- OnEnable
- OnFailedToConnectToM...
- OnFailedToConnect
- OnGUI
- OnJointBreak
- OnLevelWasLoaded
- OnMasterServerEvent
- OnMouseDown
- OnMouseDrag
- OnMouseEnter
- OnMouseExit
- OnMouseOver
- OnMouseUpAsButton
- OnMouseUp
- OnNetworkInstantiate
- OnParticleCollision
- OnPlayerConnected
- OnPlayerDisconnected
- OnPostRender
- OnPreCull
- OnPreRender
- OnRenderImage
- OnRenderObject
- OnSerializeNetworkView
- OnServerInitialized
- OnTriggerEnter
- OnTriggerExit
- OnTriggerStay
- OnWillRenderObject
- Reset
- StartCoroutine
- Start
- StopAllCoroutines
- StopCoroutine
- Update
- useGUILayout
MonoBehaviour.OnMouseUpAsButton 当鼠标作为按钮弹起时
function OnMouseUpAsButton () : void
Description描述
OnMouseUpAsButton is only called when the mouse is released over the same GUIElement or Collider as it was pressed.
OnMouseUpAsButton只有当鼠标在同一个GUIElement或Collider按下,在释放时调用。
参见:OnMouseUp.
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnMouseUpAsButton() {
Application.LoadLevel("SomeLevel");
}
}
// Loads the level named "SomeLevel" as a response
// to the user clicking on the object
//当用户在物体上点击,加载名为SomeLevel的关卡
function OnMouseUpAsButton () {
Application.LoadLevel ("SomeLevel");
}
This function is not called on objects that belong to Ignore Raycast layer.
当物体属于忽略“光线投射”层,此函数不会调用。
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.
OnMouseUpAsButton可以协同程序,简单实用yield语句。这个事件发送到附加到Collider或GUIElement的所有脚本。
IMPORTANT: This function has no effect on iPhone.
注意:此函数在iPhone上无效。
最后修改:2011年9月16日 Friday 20:22