public interface ICoroutineOwnerWhatever a coroutine belongs to, and therefore whatever can cancel it.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
An interface rather than Behavior outright, so that a system, an editor tool or a test can own coroutines without inventing a behaviour to hang them on. Behavior implements it, and that is the only implementation most code will ever see.
Cancellation is per-owner, not per-coroutine. A launched coroutine and a coroutine it awaits are indistinguishable once they are suspended — the second one's continuation is held by the first one's state machine, not by the scheduler — so a handle cannot cancel "its own" waits without also being able to name every wait beneath them. Rather than offer a Cancel that quietly misses the nested half, the unit of cancellation is the owner, which reaches all of it.
⚠ These two members say a coroutine should stop; they do not make it let go. Both are read at a resume point, so an owner that goes away between drains leaves its continuations sitting in the scheduler's waiting lists until the next one. That is fine for a game and fatal for an editor, where a detach and an assembly unload happen inside one call with no frame in between — see Cancel, which is what an owner calls to be let go of rather than merely marked.
Fields and properties (2)
bool IsDestroyedWhether the owner is gone. Its coroutines cancel at their next resume point.
int CoroutineGenerationBumped by StopCoroutines. An awaitable records the value it was created under and cancels if it no longer matches.
Used by (4)
- BehaviorVixen.Engine
- CoroutineAwaitableVixen.Engine
- CoroutineSchedulerVixen.Engine
- EntryVixen.Engine