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(); } }
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(); } }
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(); } }