View on Asset Store (opens in new tab)
Package details
- Latest version
- 1.1.0
- Last updated
- First released
- Unity version
- 2019.4.39 or later
- Package size
- 301 KB
- Files
- 12
- Favorites
- 13
- Views in the past week
- 15
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- $4.99 on
Keywords
Sub Routines
Little background tasks for Unity. Wait, repeat, run for a while, or chain steps together, all in one line each.
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 9
Sub Routines screenshot 1
About this asset
Sub Routines is a small tool we wrote because we got tired of writing the same coroutines over and over.
Each sub routine is just a condition and an action. We check it once a frame for you, so things like "wait two seconds, then do this" or "fade this in over half a second" become a single line. You can also pause them and chain them together, so a sequence of steps reads top to bottom, the way you'd describe it out loud.
using MugHeadStudios;
SubRoutines.Chain(
SubRoutines.RunFor(0.5f, t => panel.alpha = t),
SubRoutines.Wait(2f, () => label.text = "Ready?"),
SubRoutines.Do(() => StartRound())
);
What's in it
- Wait, When, While, Always, RunFor, Repeat
- Frame-based helpers: RunNextFrame, RunAfterXFrames, RunForXFrames
- Chain, to run sub routines one after another (chains can be nested)
- Pause, resume, or remove any sub routine
- No MonoBehaviour or StartCoroutine needed, so you can call it from anywhere
- A demo scene, a PDF guide, and fully commented source code
What's new in 1.1
- Updated for Unity 2022.3 LTS and newer, including Unity 6
- Now comes with assembly definitions
- Works with Enter Play Mode Options when domain reload is turned off
- One broken sub routine no longer stops the others: the error is logged and the rest keep going
- A few small bug fixes, including Repeat(1) running twice and a routine sometimes skipping a frame
Unity versions
Unity 2022.3 LTS and newer, including Unity 6. Any render pipeline, since it's code only. We checked the code against these versions but haven't tested every one in the editor yet. If something doesn't work in your version, tell us and we'll fix it.
Full documentation: https://mugheadstudios.com/docs/sub-routines
Questions or ideas? Email us at [email protected]. We read everything.
From the publisher's Asset Store listing.
Compatibility
| Unity version | Built-in | URP | HDRP | Custom |
|---|---|---|---|---|
| 2022.3.62f3 | Compatible | Compatible | Compatible | Compatible |
| 2020.3.43f1 | Compatible | Compatible | Compatible | Compatible |
| 2019.4.39f1 | Compatible | Compatible | Compatible | Compatible |
As listed on the Asset Store.