Пример #1
0
        public string TypeName(LuaType t)
        {
            IntPtr ptr = LuaAPI.lua_typename(this.m_lua, (int)t);

            if (ptr == IntPtr.Zero)
            {
                return(null);
            }
            return(LuaAPI.StringFromNativeUtf8(ptr, 0));
        }
Пример #2
0
        private static int Lua_Panic(IntPtr lua)
        {
            int    len = 0;
            IntPtr ptr = LuaAPI.luaL_tolstring(lua, -1, ref len);

            if (ptr != IntPtr.Zero)
            {
                Debug.LogError(string.Format("Lua Panic {0}", LuaAPI.StringFromNativeUtf8(ptr, len)));
            }
            return(0);
        }
Пример #3
0
        public string L_CheckString(int narg)
        {
            int    l   = 0;
            IntPtr ptr = LuaAPI.luaL_checklstring(this.m_lua, narg, ref l);

            if (ptr == IntPtr.Zero)
            {
                return(string.Empty);
            }
            return(LuaAPI.StringFromNativeUtf8(ptr, l));
        }