public void Destroy() { if (luaState != null) { if (UpdateEvent != null) { UpdateEvent.Dispose(); UpdateEvent = null; } if (LateUpdateEvent != null) { LateUpdateEvent.Dispose(); LateUpdateEvent = null; } if (FixedUpdateEvent != null) { FixedUpdateEvent.Dispose(); FixedUpdateEvent = null; } luaState = null; } }
private LuaBeatEvent GetEvent(string name) { LuaTable table = this.luaState.GetTable(name, true); if (table == null) { throw new LuaException(string.Format("Lua table {0} not exists", name), null, 1); } LuaBeatEvent result = new LuaBeatEvent(table); table.Dispose(); return(result); }
void Start() { try { UpdateEvent = GetEvent("UpdateBeat"); LateUpdateEvent = GetEvent("LateUpdateBeat"); FixedUpdateEvent = GetEvent("FixedUpdateBeat"); } catch (Exception e) { Destroy(this); throw e; } }
private void Start() { try { this.UpdateEvent = this.GetEvent("UpdateBeat"); this.LateUpdateEvent = this.GetEvent("LateUpdateBeat"); this.FixedUpdateEvent = this.GetEvent("FixedUpdateBeat"); } catch (Exception ex) { UnityEngine.Object.Destroy(this); throw ex; } }
LuaBeatEvent GetEvent(string name) { LuaTable table = luaState.GetTable(name); if (table == null) { throw new LuaException(string.Format("Lua table {0} not exists", name)); } LuaBeatEvent e = new LuaBeatEvent(table); table.Dispose(); table = null; return e; }
public void Init(LuaState state) { try { luaState = state; UpdateEvent = GetEvent("UpdateBeat"); LateUpdateEvent = GetEvent("LateUpdateBeat"); FixedUpdateEvent = GetEvent("FixedUpdateBeat"); } catch (Exception e) { Destroy(); throw e; } }
public void Destroy() { if (this.luaState != null) { if (this.UpdateEvent != null) { this.UpdateEvent.Dispose(); this.UpdateEvent = null; } if (this.LateUpdateEvent != null) { this.LateUpdateEvent.Dispose(); this.LateUpdateEvent = null; } if (this.FixedUpdateEvent != null) { this.FixedUpdateEvent.Dispose(); this.FixedUpdateEvent = null; } this.luaState = null; } }