Closed karlmarxman closed 9 years ago
+1 got the same problem in unity.
EntryPointNotFoundException: luanet_registryindex KeraLua.Lua.LuaNetRegistryIndex () NLua.LuaIndexes.get_Registry () NLua.Lua.Init () NLua.Lua..ctor () ExampleBehaviour.Awake () (at Assets/Example/ExampleBehaviour.cs:77)
use
UNITY_3D;USE_KERALUA;LUA_CORE;
Are you using the dll's provided in /Assets/plugins
? The standard Lua DLL won't work with Unity.
Two things I'd suggest:
plugins
. IE if your using the x86 version then remove the x64 version.Assets/
ProjectSettings/
lua52.dll
<...>
If you get errors involving string functions try adding WSTRING
to your compilation arguments.
Using the dlls from Assets/Plugins. I tried all 3 suggestions and didn't change the default scene's errors. Note I get a different error message: "invalid arguments to method: TestBehaviour.GetComponent Lua (at [string "chunk"]:11)" and so on for everything in the example scene. Though the first thing in function Start "Debug.Log(ExampleBehaviour)" works fine oddly enough.
I also see the "invalid arguments to method: TestBehaviour.GetComponent. I've seen this behavior replicated in my own project when attempting to call any static C# function with a string parameter.
e.g. this will work in kopilua, but fail in keralua:
Double = luanet.import_type("System.Double") result = Double.TryParse("1.05")
Curiously, a member function that takes a string parameter works fine, e.g:
StringBuilder = luanet.import_type("System.Text.StringBuilder") sb = StringBuilder() sb.Append("foo")
I spent some time digging through this today, and found that it appeared to be a problem in LuaLib.LuaNetIsStringStrict() not working as intended. I replaced all references to that call in CheckType.cs with calls to LuaLib.LuaIsString() and my scripts now all function as intended.
Hello @rje this seems to work on current version of NLua/NLua http://screencast.com/t/wBbMDO4i @Mervill can you bump Unity3D-NLua to tip of master?
If anyone could repro this on NLua/NLua a test case would be great. :smile:
@viniciusjarina I can try to update to current nlua this week and see if I can repro the issue. Seems like it'd make sense for @Mervill to bump to tip of master either way
Hello everyone!
After updating NLua, the fix suggested by @rje resolved the issue. This is most likely an issue with Unity's mono implementation. I'm uploading the fix for now, (https://github.com/Mervill/Unity3D-NLua/commit/bfc87e0fc60a1921dbfb1cbc7de552c548371e10) but I'll do some more investigation before I suggest pushing upstream.
after define KeraLua in unity pc platform ,it's work ,but android not work? any help?
after switch to android
DllNotFoundException: D:/Download/Unity3D-NLua-master/Assets/Plugins/x86/lua52.dll KeraLua.Lua.LuaLNewState () (at Assets/KeraLua/Lua.cs:33) NLua.LuaLib.LuaLNewState () (at Assets/NLua/LuaLib/LuaLib.cs:77) NLua.Lua..ctor () (at Assets/NLua/Lua.cs:278) TestBehaviour.Awake () (at Assets/Example/TestBehaviour.cs:26)
This should work fine now, recompiling the lua52 dll seems to have solved it.
Changing define to USE_KERALUA and the example scene is unable to GetComponent in function Start() as well as anything in Update. No other changes made. Is there anything else required to switch to KeraLua?