Code: Select all
Lua.RegisterFunction("StartMyCoroutine", this, SymbolExtensions.GetMethodInfo(() => StartMyCoroutine()));
...
public void StartMyCoroutine()
{
StartCoroutine(MyCoroutine());
}
IEnumerator MyCoroutine()
{
...
}
Code: Select all
public class SequencerCommandMyCoroutine : SequencerCommand
{
IEnumerator Start()
{
... // (your coroutine code here)
Stop(); // Always call stop when command is done.
}
}