StopAllCoroutines

Stops all coroutines running on this behavior.

Example

  function Start() {
// Start Coroutine DoSomething
  StartCoroutine("DoSomething", 5.0); 

//  Wait for 1 seconds
  yield WaitForSeconds(1.0);

  // Stop All Coroutine
  StopAllCoroutines();
}

function DoSomething (someParameter : float) {
  while (true) {
    // DoSomething Loop
    Debug.Log ("DoSomething Loop = " + Time.time);
    // Yield execution of this coroutine and return to the main loop until next frame
    yiel
    ]

More details

The following link provides a good explanation and tutorial of how to use coroutine:

http://marvelopermedia.com/tutorial-coroutines-pt-1-waiting-for-input/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.73.127