XUtils

UniLua

A pure C# implementation of Lua 5.2, focused on compatibility with the Unity game engine.


UniLua

A pure C# implementation of Lua 5.2 focus on compatibility with Unity3D.

UniLua是一个纯C#的Lua 5.2实现,专注于与Unity3D的兼容性。

一些补充说明

UniLua 主要关注的还是对 lua 本身的实现,而不是怎么把 Unity3D 引擎提供的功能都引入到 lua 里。

从 lua 调用 C# 函数不建议使用 FFI 库(虽然示例工程里用了,看起来方便,但是并不完善,效率也不好)。建议参考 从 Lua 调用 C# 函数 ( Calling C# funcitons from Lua ) 来自己实现封装函数。

示例工程 ( Sample Project )

To demonstrate the basic use of UniLua, a sample project is included.
Open Assets\Stages\GameMain.unity with Unity3D, and just click the “Play” button.
An icon will appear in the screen, and you can move it around with WSAD keys.

项目中包含了一个微型的示例工程,用来演示 UniLua 的基本使用。
用 Unity3D 打开 Assets\Stages\GameMain.unity 然后直接点击播放按钮运行。
屏幕上会显示一个小图标,你可以用 WSAD 键控制它四处移动。

SciMark

test on Unity3D 4.3.1, Windows 7, Intel i5-3470

  • FFT 1.07 [1024]
  • SOR 2.51 [100]
  • MC 0.66
  • SPARSE 1.59 [1000, 5000]
  • LU 1.84 [100]
  • SciMark 1.53 [small problem sizes]

Articles

  • coming soon...