Skip to content
topameng edited this page Sep 15, 2015 · 21 revisions

1. singleton<T> 派生类导出问题

  • 通过 _GT(typeof(xxx)).SetBaseType(null) 来绕过模板基类问题

2. LuaScriptException [string "Global.lua"]: 3 attempt to index global 'System' (a nil value)

  • 首先保证文件编码为utf8 多见于mac和unity5.x版本。 其次保证已经产生了wrap文件(点击菜单Lua/Gen Lua Wrap Files 和 Lua/Gen Luabinder File)。

3. 警告Crete not wrap ulua type: XXXX

  • 没有产生相应的类型wrap文件,通过反射生成了类型

4. stringWrap.cs(129,32): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context

  • Editor/Wrap 中ToLua_System_String 丢失。这个目录文件必须保证存在

5. Delegate xxx not register

  • 当一个LuaFunction参数转换为委托参数时发生, 说明你没有注册这个委托类型到lua中。如何注册,参见 Export

6. LuaScriptExcepn:[string "Golbal.lua"]:1:unexpected symbol near '�'

  • 字符串编码问题, 修改文件为utf-8编码

7. LuaScriptException: [string "Event.lua"]:132: [string "Timer.lua"]:168: attempt to index local 'self' (a nil value)

  • 在mac luac vm 上出现,见cstolua说明, 自行修改Event.lua

7. 在什么情况可以自动转LuaFunction为委托

  • 做为非重载函数参数。 做为属性赋值

Clone this wiki locally