public static Coroutine StartLuaCoroutineForBehav(this MonoBehaviour behav, LuaOnStackFunc lfunc) { if (behav != null) { var work = EnumLuaCoroutine(lfunc); if (work is IDisposable) { var info = new CoroutineRunner.CoroutineInfo() { behav = behav, work = work }; return(info.coroutine = behav.StartCoroutine(CoroutineRunner.SafeEnumerator(work, info))); } else { return(behav.StartCoroutine(EnumLuaCoroutine(lfunc))); } } else { return(CoroutineRunner.StartCoroutine(EnumLuaCoroutine(lfunc))); } }