unity stop coroutine after time code example
Example: stop specific coroutine unity
Coroutine co;
// start the coroutine the usual way but store the Coroutine object that StartCoroutine returns.
co = StartCoroutine(MyCoroutine());
// stop the coroutine
StopCoroutine(co);