Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
U

Unity3D-NLua

> 编程语言
Open source

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

189 stars0 likes0 views
WebsiteGitHub

About

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

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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

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