Ejemplo n.º 1
0
        // 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();
                }
            }
        }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (L != null)
     {
         L.Tick();
     }
 }
Ejemplo n.º 3
0
    /// <summary>
    /// 只要是为lua虚拟机提供tick,做垃圾回收
    /// </summary>
    public void Tick()
    {
        luaenv.Tick();

        foreach (var s in subModules.Values)
        {
            s.Tick();
        }
    }
Ejemplo n.º 4
0
 /// <summary>
 /// 帧刷新
 /// </summary>
 public void Update()
 {
     if (mLuaUpdate != null)
     {
         mLuaUpdate();
     }
     if (Time.time - lastGCTime > GCInterval)
     {
         mLuaenv.Tick();
         lastGCTime = Time.time;
     }
 }
Ejemplo n.º 5
0
        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;
                }
            }
        }
Ejemplo n.º 6
0
        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));
            }
        }
Ejemplo n.º 7
0
 //----------------------------------------------------------------------------
 private void Update()
 {
     luaEnv?.Tick();
 }