Stopping Coroutines

Hello,

I saw in the documentation that you could stop all coroutines with a specified name (on a given object). Is there any way to stop a single instance of a coroutine on an object. Lets say I started 5 coroutines with the same function and I only wanted to stop one of them.

Each time you start a new coroutine you could pass a unique boolean to it and exit when the boolean becomes false. The booleans could be stored in an array to keep things simple; each index would represent one instance of the coroutine.

I was kind of hoping I could do something with the Coroutine returned from StartCoroutine, but that’s close anyway.

Thanks