Simple tu use and foolproof. It uses abstraction to make it almost invisible on your code and easy to reuse it.
-
Have the script
StaticMonoBehaviour
in your project -
Start coroutine:
StaticCoroutine.Start(ref _Coroutine, ExampleCoroutine(), () => { Debug.Log("Coroutine ended"); });
- Stop coroutine:
StaticCoroutine.Stop(ref _Coroutine);
- Any Unity version
- Any pipeline (Build-in, URP, HDRP, etc)
⭐ Star if you like it
❤️️ Follow me for more