LuaInterface.LuaDLL.lua_tostring C# (CSharp) Method

lua_tostring() public static method

public static lua_tostring ( IntPtr luaState, int index ) : string
luaState IntPtr
index int
return 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;
        }

Usage Example

示例#1
0
        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);
        }
All Usage Examples Of LuaInterface.LuaDLL::lua_tostring
LuaDLL