Nice! I remember there being another plugin a while back when I was looking into this (kopilua). I suppose this solves most of the issues surrounding integration. I guess you took the dll route (hence LuaInterface) so definitely can’t use this for browser runtime.
Also one of the main reason I took interest in using Lua in Unity is to allow scripting during runtime and be able to execute it. I’m guessing this plugin allows for that?
The LuaInterface DLL works fine in browsers/web player. The Dialogue System for Unity uses George Foot’s KopiLuaInterface, which you can see in action in all the browser demo scenes here: http://www.pixelcrushers.com/dialogue-system-demos/
“Unity does not support Native Plugins for the WebPlayer, so uLua will never work until they change that policy due to using a C library for the Lua runtime.”
Is there a way to make this package work with WebPlayer like KopiLuaInterface from George Foot ? Pixel Crusher got KopiLuaInterface working in the Dialogue System.
You just need to play the demos to see proof. It uses KopiLua, which is a pure C# implementation of Lua, so no issues with C libraries.
Sorry, I didn’t mean to sidetrack this thread. Since virror wrote “LuaInterface based for powerful C# integration,” I figured uLua would be the same, which is the only reason why I mentioned it.
I’m kind of interested in a Lua add-on for unity, but there’s not a lot of info about this and what it’s capable of. The lack of replies from the author is a bit discerning.
I’ve been emailing the author and he’s answering right away. Perhaps he’s not getting notifications from the forum… I did inform him that people are using the forum.
I haven’t done any benchmarking, but I can’t imagine that the C implementation would be significantly faster than the C# implementation in most cases. They’re both written in native, compiled languages. I’d be curious to see if there was any performance difference in benchmarks. Even if there were, for the Dialogue System it wouldn’t make any difference in performance for the player because of where Lua is used in it. However, if you really wanted to swap out KopiLuaInterface, as I mentioned earlier on the Dialogue System thread there’s a bridge class between the Dialogue System and whatever Lua implementation is underneath. You could always replace that bridge class with one that references a different Lua implementation.
Yes it does, additionally it provides a means to DLC game logic (missions, scripted abilities etc) which you otherwise cannot do in Unity at the moment.
I can’t comment on existing C# implementations at the moment but uLua uses LuaJIT which when compared to the standard Lua runtime has -huge- performance improvements.
Sorry, the JIT support slipped my mind when I was replying. Yes, I won’t argue at all that this will make it faster than KopiLuaInterface. For the purposes of the Dialogue System, it won’t make any noticeable difference, but I can imagine uses where it would make a big difference.