百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
U

Unity3D-NLua

> 编程语言
开源

一切您需要的,以便在 Unity3D 中开始使用 Lua。兼容 Indie 和 Pro。

189 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一切您需要的,以便在 Unity3D 中开始使用 Lua。兼容 Indie 和 Pro。

Unity3D-NLua

Everything you need to get started using Lua in Unity3D v5. Indie & Pro compatible.

This template project implements NLua which drives KeraLua, a C VM wrapper. Both projects are licensed under the MIT. This project is licensed under the Boost Software Licence.

Unity 5 Update

With the release of Unity 5, native dlls are now allowed under the Indie licnence. Therefore the previous support for KopiLua has been depreciated.

Scripting Symbols

NLua requires some scripting symbols to be defined:

UNITY_3D - Suppress warnings about CLSC Attributes.

USE_KERALUA - KeraLua is an interop wrapper to the NLua fork of the original C VM (The DLL should be placed in a Plugins\ folder in your project). NLua can also interface with KopiLua (USE_KOPILUA), a pure C# implementation of lua, however it is not supported by this project.

LUA_CORE & CATCH_EXCEPTIONS - Required by the VM.

Your Scripting Define Symbols list should end up looking like:

UNITY_3D; USE_KERALUA; LUA_CORE; CATCH_EXCEPTIONS

You may also notice other symbols used throughout NLua, none of these have been tested for compatibility.

FAQ

How do I Instantiate new objects?

See the SpawnSphere example.

How do I run C# coroutines?

See this comment for details, essentially though you either have to call lua functions indriectily, or roll your own coroutine manager (not hugely difficult). Direct support for coroutines may be included in future releases.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言