All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams
Documentation · Quick Start · QQ Group: 467608841 / 233840761
Game Frame X Coroutine is a Unity coroutine management package based on the GameFrameX framework, extending Unity's built-in coroutine management functionality.
Coroutine Component - Provides interfaces that extend Unity's built-in coroutine management capabilities.
-
Start Coroutine: Use
StartCoroutine(IEnumerator enumerator)to start a coroutine. Iterators and Unity coroutine objects are stored in a concurrent dictionary for easy access and management. -
Stop Coroutine: Stop individual coroutines via
StopCoroutine(IEnumerator enumerator)orStopCoroutine(UnityEngine.Coroutine coroutine). These methods ensure coroutines are removed from both Unity and the internal dictionary, preventing memory leaks. -
Stop All Coroutines: Stop all running coroutines via
StopAllCoroutines(). This method ensures clean stopping of all coroutines and clears the internal tracking dictionary. -
End of Frame Callback: The
WaitForEndOfFrameFinish(System.Action callback)method allows executing a callback after the current frame's rendering is complete.
- Unity 2017.1 or higher
Choose one of the following methods:
-
Edit your Unity project's
Packages/manifest.jsonand add thescopedRegistriessection:{ "scopedRegistries": [ { "name": "GameFrameX", "url": "https://gameframex.upm.alianblank.uk", "scopes": [ "com.gameframex" ] } ], "dependencies": { "com.gameframex.unity.coroutine": "1.0.3" } }scopescontrols which packages are resolved through this registry. Only packages whose names start withcom.gameframexwill be fetched from it. -
Add to
manifest.jsondependencies:{ "com.gameframex.unity.coroutine": "https://github.com/gameframex/com.gameframex.unity.coroutine.git" } -
Use Package Manager in Unity with Git URL:
https://github.com/gameframex/com.gameframex.unity.coroutine.git -
Clone the repository into your Unity project's
Packagesdirectory. It will be loaded automatically.
IEnumerator YourCoroutine()
{
// Coroutine execution content
yield return null;
}
CoroutineComponent coroutineComponent = gameObject.AddComponent<CoroutineComponent>();
coroutineComponent.StartCoroutine(YourCoroutine());IEnumerator yourCoroutine = YourCoroutine();
coroutineComponent.StopCoroutine(yourCoroutine);coroutineComponent.StopAllCoroutines();void YourCallback()
{
// Callback execution content
}
coroutineComponent.WaitForEndOfFrameFinish(YourCallback);Note: When adding CoroutineComponent to a GameObject, ensure there are no other components of the same type in your scene, as the class uses the [DisallowMultipleComponent] attribute.
- Documentation: https://gameframex.doc.alianblank.com
- Repository: https://github.com/GameFrameX/com.gameframex.unity.coroutine
- Issues: https://github.com/GameFrameX/com.gameframex.unity.coroutine/issues
| Package | Description |
|---|---|
| (无) | - |
- QQ Group: 467608841 / 233840761
See Releases for changelog.
See LICENSE for details.