Tencent/xLua ? reverse-engineered prompt
Reverse engineered prompt
Build me a Unity friendly Lua scripting setup for a C# project, something like xLua. I want to be able to run Lua from C#, call C# methods from Lua, and also call Lua functions back from C# in a simple way. Please include a working hello world example, a couple of small demos for UI logic, coroutines, async style flow, and a hotfix example where Lua can replace an existing C# method at runtime.
Make it easy to drop into a Unity project by keeping the folder structure ready for Assets. I’d also like clear docs or comments showing how to install it, how to set up the basic LuaEnv lifecycle, and how to avoid extra GC when passing values between Lua and C#. If you need to check current Unity or Lua docs online, go ahead.
Are you gonna build this?
make sure you review the code using coderabbit