Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Does IsInvoking report coroutines?

Discussion in 'Editor & General Support' started by mindlace, May 6, 2007.

  1. mindlace

    mindlace

    Joined:
    Mar 31, 2007
    Posts:
    24
    Just that, I guess; I'd like to know if I have any running coroutines before I stop/start them...

    ~ethan
     
  2. mindlace

    mindlace

    Joined:
    Mar 31, 2007
    Posts:
    24
    No; it doesn't. Apparently there's no way to know what coroutines are running.
     
    CloudyVR likes this.
  3. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    I've kept script wide boolean globals for coroutines in the past to keep track of which coroutines are invoking when needed. Also if I just want to make sure only one instance of the coroutine is running, I put a StopCoroutine() before StartCoroutine always. Stopping a non-running coroutine doesn't produce an error, just silently doesn't do anything.

    Hope that helps,
    -Jon