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.StopAllCoroutines 停止所有协同程序
function StopAllCoroutines () : void
Description描述
Stops all coroutines running on this behaviour.
停止所有动作的协同程序。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
IEnumerator DoSomething() {
while (true) {
yield return null;
}
}
public void Awake() {
StartCoroutine("DoSomething");
StopAllCoroutines();
}
}
// Starts the coroutine
// 开始协同程序.
StartCoroutine ("DoSomething");
// Cancels the coroutine immediately afterwards
// 随后立即取消之.
function DoSomething () {
while (true) {
yield;
}
}
StopAllCoroutines();
最后修改:2011年1月2日 Sunday 13:55