Struct CoroutineBuilder
- Namespace
- LunyScript.ScriptApi
- Assembly
- LunyScript.dll
Entry point for the Coroutine fluent builder chain. Usage: Coroutine("name").For(3).Seconds().OnFrameUpdate(blocks).WhenElapsed(blocks); Coroutine("name").OnFrameUpdate(blocks).WhenStopped(blocks).Do(blocks); Coroutine("name").OnHeartbeat(blocks).Do(blocks);
public readonly struct CoroutineBuilder
Methods
Every(double)
A repeating timer coroutine which fires at the specified interval. The Do(blocks) execute on every interval elapse.
public CoroutineTimerBuilder<CoroutineTimerAmountSet> Every(double interval)
Parameters
intervaldouble
Returns
In(double)
A finite timer coroutine which fires after the specified duration. The Do(blocks) execute when elapsed.
public CoroutineTimerBuilder<CoroutineTimerAmountSet> In(double duration)
Parameters
durationdouble