Header menu logo BaboonAPI

Coroutines Module

Types

Type Description

CoroutineBuilder

WaitForTask<'a>

Suspends the coroutine until the given .NET task completes

YieldTask<'r>

Async operation type

Functions and values

Function or value Description

awaitAssetBundle

Full Usage: awaitAssetBundle

Returns: AssetBundleCreateRequest -> YieldTask<AssetBundle>

Await an AssetBundleCreateRequest, returning the loaded AssetBundle

Returns: AssetBundleCreateRequest -> YieldTask<AssetBundle>

awaitAsyncOperation binder op

Full Usage: awaitAsyncOperation binder op

Parameters:
    binder : 'op -> 'r
    op : 'op

Returns: YieldTask<'r>

Await an AsyncOperation

binder : 'op -> 'r
op : 'op
Returns: YieldTask<'r>

awaitResource

Full Usage: awaitResource

Returns: ResourceRequest -> YieldTask<Object>

Await a ResourceRequest, returning the loaded Unity Object

Returns: ResourceRequest -> YieldTask<Object>

coroutine

Full Usage: coroutine

Returns: CoroutineBuilder

Unity coroutine computation expression

Returns: CoroutineBuilder

each runner task

Full Usage: each runner task

Parameters:
Returns: IEnumerator<YieldInstruction>

Register a callback that is called after the YieldTask is run by Unity.

This function returns an IEnumerator that must be passed to Unity before the callback will run!

runner : 'a -> unit
task : YieldTask<'a>
Returns: IEnumerator<YieldInstruction>

map binder task

Full Usage: map binder task

Parameters:
Returns: YieldTask<'b>

Transform a YieldTask

binder : 'a -> 'b
task : YieldTask<'a>
Returns: YieldTask<'b>

run task

Full Usage: run task

Parameters:
Returns: IEnumerator<YieldInstruction>

Consume a YieldTask into an IEnumerator, allowing it to be started as a Unity coroutine

task : YieldTask<unit>
Returns: IEnumerator<YieldInstruction>

Type something to start searching.