View on Asset Store (opens in new tab)
Package details
- Latest version
- 3.18.0
- Last updated
- First released
- Unity version
- 2022.3.62 or later
- Package size
- 83 KB
- Files
- 4
- Favorites
- 1,655
- Views in the past week
- 87
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- Free on
Keywords
- Search for Performance
- Search for Coroutines
- Search for Animation
- Search for High Performance
- Search for performance optimization
- Search for Free Coroutines
- Search for Allocation Free
- Search for Beginner Friendly
- Search for Drop In Replacement
- Search for Simple Coroutine
- Search for Lightweight Library
- Search for Free Performance
More Effective Coroutines [FREE]
A faster and more functional library for running coroutines.
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 3
More Effective Coroutines [FREE] video 1
About this asset
More Effective Coroutines (MEC) is an improved implementation of coroutines.
When you use Unity's default coroutines you will have to be very careful about how you use them or else they will allocate memory that the garbage collector later has to clean up. This can cause your app to randomly skip frames. MEC solves that issue for coroutines, while also making coroutines more powerful by running about twice as fast as Unity's default coroutines do and providing you with a host of new options that Unity's default coroutines don't have.
This is the free version. The free version of MEC contains the minimum set of features, whereas the pro version contains the full set. Both versions run on the same super-fast core.
Switching between MEC coroutines and Unity's default coroutines is really easy. They can even be used side by side in the same project.
Advantages of MEC (both free and pro):
- MEC doesn't require that your class inherit from MonoBehaviour in order to run a coroutine.
- Coroutines can be "tagged" with a string when created, allowing you to kill or pause coroutines individually or as a group.
- MEC contains no pre-compiled DLLs, which makes debugging easier.
- MEC contains useful extra segments, like SlowUpdate.
- MEC coroutines can be paused and resumed.
Limitations of free that don't exist in pro:
- The free version of MEC contains only the minimum number of timing segments. The pro version has the following additional segments: RealtimeUpdate, EditorUpdate, EditorSlowUpdate, EndOfFrame, and ManualTimeframe.
- In MEC free a coroutine cannot switch from one timing segment to another without starting a new coroutine.
- You cannot query whether a coroutine is running or add or remove tags to a running coroutine.
- You cannot run a singleton instance of a coroutine like you can in Pro.
For more information, see the documentation here.
From the publisher's Asset Store listing.
Technical details
A drop-in replacement
MEC Free is a lightweight library that replaces Unity's coroutine calls with faster equivalents. Zero setup: import it, change StartCoroutine to Timing.RunCoroutine, and existing code keeps working. It runs side by side with Unity's own coroutines, so you can convert one script at a time rather than committing the whole project at once.
Readable source, no black box
Ships as readable source code with no pre-compiled DLLs. The profiler and debugger step straight into the library, and you can read exactly what it does — useful whether you are learning how coroutines work under the hood or auditing what goes into your build.
What it fixes
Unity's implementation allocates on every yield return, and the garbage collection that follows is what surfaces as stutter and hitching in a project that otherwise runs clean. MEC removes that allocation. WaitForSeconds and the standard yield instructions have equivalents that wait the same number of seconds without allocating. No MonoBehaviour inheritance required, so any class can start one.
Timing segments
Update, FixedUpdate, LateUpdate and SlowUpdate. SlowUpdate moves logic that does not need to run every frame onto a relaxed tick, which is usually the first easy win in a project that is running hot.
Tags and control
Tag with a string when you create one, then kill or pause a whole group together. Individual ones pause and resume from their handle.
What Pro adds
The RealtimeUpdate, EditorUpdate, EditorSlowUpdate, EndOfFrame and ManualTimeframe segments; editor coroutines that run while the app is not playing; SwitchCoroutine; singleton instances; runtime tag editing; and the extension methods Delay, Append, Prepend, CancelWith, Superimpose and Hijack. Both editions share the same core.