public LuaState(IntPtr l) { L = l; if (L != IntPtr.Zero) { _ObjCache = LuaObjCache.GetOrCreateObjCache(L); } }
public LuaState() { L = lual.newstate(); L.openlibs(); _Closer = new LuaStateCloser() { _L = L }; LuaStateAttachmentManager.GetOrCreateAttachmentManager(this); _ObjCache = LuaObjCache.GetOrCreateObjCache(L); }
public override IntPtr PushLua(IntPtr l, object val) { var h = base.PushLua(l, val); LuaObjCache.RegObj(l, val, -1, h); CapsUnityLuaBehav real = val as CapsUnityLuaBehav; if (real != null) { if (real.ShouldBindLua) { real.BindLua(l, -1); } } return(IntPtr.Zero); }
public LuaThread(LuaOnStackFunc func) : base(IntPtr.Zero) { if (!ReferenceEquals(func, null) && func.L != IntPtr.Zero) { L = func.L.newthread(); Refid = func.L.refer(); func.L.pushvalue(func.StackPos); var reffunc = func.L.refer(); _Func = new LuaFunc(); _Func.L = L; _Func.Refid = reffunc; } if (L != IntPtr.Zero) { _ObjCache = LuaObjCache.GetOrCreateObjCache(L); } }
public LuaThread(LuaFunc func) : base(IntPtr.Zero) { if (!ReferenceEquals(func, null) && func.L != IntPtr.Zero) { L = func.L.newthread(); Refid = func.L.refer(); if (func.Refid != 0) { L.getref(func.Refid); _Func = new LuaFunc(L, -1); L.pop(1); } } if (L != IntPtr.Zero) { _ObjCache = LuaObjCache.GetOrCreateObjCache(L); } }