// Update is called once per frame public virtual void Update() { _luaenv.Tick(); if (_cotype == CoType.CO) { CoWorker(); while (_renderQueue.Count > 0) { Actor.RenderHandler handler = _renderQueue.Dequeue(); _app.StartCoroutine(CoHandler(handler)); //handler(); } } else { // 此段代码可以用协程 while (_renderQueue.Count > 0) { Actor.RenderHandler handler = null; lock (_renderQueue) { handler = _renderQueue.Dequeue(); } handler(); } } }
// Update is called once per frame void Update() { if (L != null) { L.Tick(); } }
/// <summary> /// 只要是为lua虚拟机提供tick,做垃圾回收 /// </summary> public void Tick() { luaenv.Tick(); foreach (var s in subModules.Values) { s.Tick(); } }
/// <summary> /// 帧刷新 /// </summary> public void Update() { if (mLuaUpdate != null) { mLuaUpdate(); } if (Time.time - lastGCTime > GCInterval) { mLuaenv.Tick(); lastGCTime = Time.time; } }
internal const float GCInterval = 1;//1 second private void Update() { if (LuaEnv != null) { LuaEnv.Tick(); if (Time.time - LuaController.lastGCTime > GCInterval) { if (LuaEnv.Memroy > 50) { LuaEnv.GC(); } LuaController.lastGCTime = Time.time; } } }
static int _m_Tick(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); XLua.LuaEnv gen_to_be_invoked = (XLua.LuaEnv)translator.FastGetCSObj(L, 1); { gen_to_be_invoked.Tick( ); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
//---------------------------------------------------------------------------- private void Update() { luaEnv?.Tick(); }