xLua icon indicating copy to clipboard operation
xLua copied to clipboard

xLua is a lua programming solution for C# ( Unity, .Net, Mono) , it supports android, ios, windows, linux, osx, etc.

Results 221 xLua issues
Sort by recently updated
recently updated
newest added

用 lua pairs 会提示报错 [string "chunk"]:23: attempt to call a nil value (method 'GetEnumerator')

![image](https://user-images.githubusercontent.com/6949888/116183771-2206e980-a751-11eb-81b7-8cbd8d8ce3e0.png) 在Check中不使用的缓存对象为什么是Replace为null,而不是Remove掉,Replace为null时,freelist不会改变,这个空的Slot不会被再次使用吧

> ``` local dll_path = "D:\\Projects\\Lua\\lua-excel-tools\\bin\\luacom.dll" local func = package.loadlib(dll_path, "luaopen_luacom") print("module init func", type(func))``` 这段代码我在lua里边运行 type(func)是function 在xlua里边运行是nil

因为[faq教程](https://github.com/Tencent/xLua/blob/master/Assets/XLua/Doc/faq.md#%E6%9C%89%E7%9A%84unity%E5%AF%B9%E8%B1%A1%E5%9C%A8c%E4%B8%BAnull%E5%9C%A8lua%E4%B8%BA%E5%95%A5%E4%B8%8D%E4%B8%BAnil%E5%91%A2%E6%AF%94%E5%A6%82%E4%B8%80%E4%B8%AA%E5%B7%B2%E7%BB%8Fdestroy%E7%9A%84gameobject)中提到了这个问题,所以我只是想提一个建议,加在教程里。 可惜的是,如果没有按照教程,没有预先配置一个`IsNull()`方法,那这个问题在Lua里写代码就很尴尬了。 经过我尝试,可以用以下代码解决,我这里版本为2019.4 ,其他Unity多种版本还没测试 参考Unity引擎源码为: https://github.com/Unity-Technologies/UnityCsReference/blob/2019.4/Runtime/Export/Scripting/UnityEngineObject.bindings.cs ``` csharp public override bool Equals(object other) { Object otherAsObject = other as Object; // A UnityEngine.Object can only be equal to another UnityEngine.Object...

coroutine_call原始代码 ```lua local function coroutine_call(func) return function(...) local co = coroutine.create(func) assert(coroutine.resume(co, ...)) end end ``` 在async_test样例内例子中listener作为void返回值可以正常运行,但如果存在以下情况: 1.C#需要调用lua方法并需要其返回某些结果 `public Func LuaCalc;` 2.该lua方法需要异步回调C#方法并等待返回其他信息 ``` local function calc(a,b) c=CS.Simple.StaticCaller.LuaGetintInfo_From_NetWork() return a+b+c end...

![5222a2a5bc9a4acd](https://user-images.githubusercontent.com/17812307/111561015-c0bb2600-8761-11eb-91c4-dfb01ae3170a.png)

![}RE2$}Z6HJ0QS`L2ULB}3$5](https://user-images.githubusercontent.com/31931585/110622573-9d7afe80-81d6-11eb-88a4-3cf844924c92.png)

非必现,而且是随机错误,并非加载到某个文件时固定报错。 原先项目使用Unity2017.4.14,很长一段时间内运行正常,之后开始有一定概率出现。 最近项目升到Unity2018.4版本,此报错出现概率大大提高,几乎必现。 通过collectgarbage(count)打印出来的,顺利加载完后大概在40000+左右。 xlua版本已更新到当前最新,使用的是luajit,尝试过使用luajit_GC64,没有改善。 报错内容: LuaException: error loading module xxx from CustomLoader, not enough memory

luaEnvManager.instance.luaEnv.DoString("require 'MuxicMain'"); LuaException: error loading module MuxicMain from CustomLoader, MuxicMain: not a precompiled chunk ![image](https://user-images.githubusercontent.com/31931585/109908535-6e98f000-7cdf-11eb-84e6-24b691ec81ae.png)