Class Coroutine<T>

The Coroutine class implements an asynchronous function that can be repeatedly called to continue the execution where it last called yield.

This is similar to Component Coroutines with the main difference being that the Coroutine must be manually updated each frame by a call to continue.

Type Parameters

  • T

Constructors

Accessors

Methods

Constructors

  • Type Parameters

    • T

    Parameters

    • target: object
    • generator: (() => Generator<T, any, any>)
        • (): Generator<T, any, any>
        • Returns Generator<T, any, any>

    • OptionalonFinalize: (() => void)
        • (): void
        • Returns void

    Returns Coroutine<T>

Accessors

  • get isFinalized(): boolean
  • Determines if the courotine finished.

    Returns boolean

Methods

  • Aborts the execution and releases the function.

    Returns void

  • Continues the coroutine.

    Returns T