Skip to content

一些简单的说明 ( Quick Start )

xebecnan edited this page Nov 3, 2013 · 1 revision

You could use UniLua in reference to the standard Lua.
The syntax of Lua language is exactly the same as standard Lua.
So you could make use of the standard Lua 5.2 Reference Manual.

Most C API of standard Lua have a counterpart in C# API of UniLua.
For example, instead of using lua_pushnumber(L, 42), you can use L.PushNumber(42)
Interface functions defined in lua.h and lauxlib.h can be found in "interface ILuaAPI" defined in LuaAPI.cs and "interface ILuaAuxLib" defined in LuaAuxLib.cs

大部分的使用是可以参考标准的 Lua 官方文档和 Lua 教程的。
Lua 本身的语法是完全一样的。你可以用官方的文档来帮助理解和使用UniLua

C API 和 C# API 之间有个对应关系。
例如 lua_pushnumber() 这个 C API 对应到 UniLua 里就是 lua.PushNumber()
所有标准 lua 中 lua.h 和 lauxlib.h 里定义的接口,都对应 LuaAPI.cs 里定义的 ILuaAPI 和 LuaAuxLib.cs 里定义的 ILuaAuxLib 接口。