Skip to content

GameFrameX/com.gameframex.unity.coroutine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game Frame X Logo

Game Frame X Coroutine

License Version Unity Version Documentation

All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams


Documentation · Quick Start · QQ Group: 467608841 / 233840761


English | 简体中文 | 繁體中文 | 日本語 | 한국어

Project Overview

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.

Features

  1. 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.

  2. Stop Coroutine: Stop individual coroutines via StopCoroutine(IEnumerator enumerator) or StopCoroutine(UnityEngine.Coroutine coroutine). These methods ensure coroutines are removed from both Unity and the internal dictionary, preventing memory leaks.

  3. Stop All Coroutines: Stop all running coroutines via StopAllCoroutines(). This method ensures clean stopping of all coroutines and clears the internal tracking dictionary.

  4. End of Frame Callback: The WaitForEndOfFrameFinish(System.Action callback) method allows executing a callback after the current frame's rendering is complete.

Quick Start

System Requirements

  • Unity 2017.1 or higher

Installation

Choose one of the following methods:

  1. Edit your Unity project's Packages/manifest.json and add the scopedRegistries section:

    {
      "scopedRegistries": [
        {
          "name": "GameFrameX",
          "url": "https://gameframex.upm.alianblank.uk",
          "scopes": [
            "com.gameframex"
          ]
        }
      ],
      "dependencies": {
        "com.gameframex.unity.coroutine": "1.0.3"
      }
    }

    scopes controls which packages are resolved through this registry. Only packages whose names start with com.gameframex will be fetched from it.

  2. Add to manifest.json dependencies:

    {
       "com.gameframex.unity.coroutine": "https://github.com/gameframex/com.gameframex.unity.coroutine.git"
    }
  3. Use Package Manager in Unity with Git URL: https://github.com/gameframex/com.gameframex.unity.coroutine.git

  4. Clone the repository into your Unity project's Packages directory. It will be loaded automatically.

Usage Examples

Start a Coroutine

IEnumerator YourCoroutine()
{
    // Coroutine execution content
    yield return null;
}

CoroutineComponent coroutineComponent = gameObject.AddComponent<CoroutineComponent>();
coroutineComponent.StartCoroutine(YourCoroutine());

Stop a Coroutine

IEnumerator yourCoroutine = YourCoroutine();
coroutineComponent.StopCoroutine(yourCoroutine);

Stop All Coroutines

coroutineComponent.StopAllCoroutines();

End of Frame Callback

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 & Resources

Dependencies

Package Description
(无) -

Community & Support

  • QQ Group: 467608841 / 233840761

Changelog

See Releases for changelog.

License

See LICENSE for details.

About

GameFrameX Unity Coroutine component providing enhanced coroutine management with pooling and lifecycle control

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages