using UnityEngine; using XLua; using System.Collections.Generic; using System.Collections; using System; [LuaCallCSharp] public class Coroutine_Runner : MonoBehaviour { public void YieldAndCallback(object to_yield, Action callback) { StartCoroutine(CoBody(to_yield, callback)); } private IEnumerator CoBody(object to_yield, Action callback) { if (to_yield is IEnumerator) yield return StartCoroutine((IEnumerator)to_yield); else yield return to_yield; callback(); } } public static class CoroutineConfig { [LuaCallCSharp] public static List LuaCallCSharp { get { return new List() { typeof(WaitForSeconds), typeof(WWW) }; } } }