From b6a776ee7c184443d0fc2ed462a395f1b0191a94 Mon Sep 17 00:00:00 2001 From: pangweiwei Date: Sun, 14 Jan 2018 15:56:15 +0800 Subject: [PATCH] fix matchType for byte[] --- Assets/Plugins/Slua_Managed/LuaObject.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Plugins/Slua_Managed/LuaObject.cs b/Assets/Plugins/Slua_Managed/LuaObject.cs index 5bb827a9..a7bd61e9 100644 --- a/Assets/Plugins/Slua_Managed/LuaObject.cs +++ b/Assets/Plugins/Slua_Managed/LuaObject.cs @@ -672,7 +672,7 @@ public static bool matchType(IntPtr l, int p, LuaTypes lt, Type t) } else if (t == typeof(char[]) || t==typeof(byte[])) { - return lt == LuaTypes.LUA_TSTRING; + return lt == LuaTypes.LUA_TSTRING || lt == LuaTypes.LUA_TUSERDATA; } switch (lt) @@ -941,6 +941,7 @@ static public bool checkArray(IntPtr l, int p, out T[] ta) } else { + object obj = checkObj (l, p); Array array = checkObj(l, p) as Array; ta = array as T[]; return ta != null;