public static lua_tostring ( IntPtr luaState, int index ) : string | ||
luaState | IntPtr | |
index | int | |
Résultat | string |
public static string lua_tostring(IntPtr luaState, int index)
{
int strlen;
IntPtr str = luaS_tolstring32(luaState, index, out strlen); // fix il2cpp 64 bit
if (str != IntPtr.Zero)
{
return Marshal.PtrToStringAnsi(str, strlen);
}
return null;
}
private static int Panic(IntPtr L) { string text = string.Format("PANIC: unprotected error in call to Lua API ({0})", LuaDLL.lua_tostring(L, -1)); throw new Exception(text); }