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.OnDestroy 当销毁
function OnDestroy () : void
Description描述
This function is called when the MonoBehaviour will be destroyed.
当MonoBehaviour将被销毁时,这个函数被调用。
OnDestroy will only be called on game objects that have previously been active.
OnDestroy只会在预先已经被激活的游戏物体上被调用。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnDestroy() {
print("Script was destroyed");
}
}
function OnDestroy () {
print("Script was destroyed");
}
OnDestroy cannot be a co-routine.
OnDestroy不能用于协同程序。
最后修改:2011年4月16日 Saturday 17:49