Exemplo n.º 1
0
        public void OnUpdate(float dt)
        {
            SetObject();

            LuaScriptManager.PushScript(this);

            try
            {
                m_OnUpdateFunc?.Call(dt);
            }
            catch (LuaException e)
            {
                Console.WriteLine(e.Message);
            }

            LuaScriptManager.PopScript();
            if (LuaScriptManager.PeekScript() != null)
            {
                LuaScriptManager.PeekScript().SetObject();
            }
        }
Exemplo n.º 2
0
        public void OnInit()
        {
            BindParent();
            SetObject();

            LuaScriptManager.PushScript(this);

            try
            {
                m_OnInitFunc?.Call();
            } catch (LuaException e)
            {
                Console.WriteLine(e.Message);
            }

            LuaScriptManager.PopScript();
            if (LuaScriptManager.PeekScript() != null)
            {
                LuaScriptManager.PeekScript().SetObject();
            }
        }
Exemplo n.º 3
0
        public void OnDispose()
        {
            SetObject();

            LuaScriptManager.PushScript(this);

            try
            {
                m_OnDisposeFunc?.Call();
            }
            catch (LuaException e)
            {
                Console.WriteLine(e.Message);
            }

            s_ThisTable[m_TablePath] = null;

            LuaScriptManager.PopScript();
            if (LuaScriptManager.PeekScript() != null)
            {
                LuaScriptManager.PeekScript().SetObject();
            }
        }