docs
Systems
Execution
CoroutineSystem
Public API Reference

API Reference

This page lists the public members defined in the CoroutineSystem source. Private members such as CreateInstance and Awake are omitted.

CoroutineHost

Namespace: SaffronLibrary.Prime.Systems.Coroutine

A sealed MonoBehaviour that runs coroutines on behalf of non-MonoBehaviour code. It is marked DisallowMultipleComponent and is created automatically on first use. It is not intended for gameplay code.

[DisallowMultipleComponent]
public sealed class CoroutineHost : MonoBehaviour

Instance

Global access point for the CoroutineHost. The getter creates the host GameObject if no instance exists yet.

public static CoroutineHost Instance { get; }

Returns: CoroutineHost

Run

Starts the supplied routine as a Unity coroutine on the host. If routine is null, the method returns without starting anything. The method is intended for infrastructure and flow systems only.

public void Run(IEnumerator routine)

Parameters:

NameTypeDescription
routineIEnumeratorThe coroutine to run. Null values are ignored.

Returns: void

Example:

CoroutineHost.Instance.Run(SomeIEnumerator());

Other public types

The source defines no other public classes, interfaces, enums, delegates, or events.