本文整理汇总了C#中LuaInterface.ObjectTranslator.getRawNetObject方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectTranslator.getRawNetObject方法的具体用法?C# ObjectTranslator.getRawNetObject怎么用?C# ObjectTranslator.getRawNetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LuaInterface.ObjectTranslator
的用法示例。
在下文中一共展示了ObjectTranslator.getRawNetObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dumpStack
public static void dumpStack(ObjectTranslator translator, IntPtr luaState)
{
int num = LuaDLL.lua_gettop(luaState);
for (int i = 1; i <= num; i++)
{
LuaTypes type = LuaDLL.lua_type(luaState, i);
if (type != LuaTypes.LUA_TTABLE)
{
LuaDLL.lua_typename(luaState, type);
}
LuaDLL.lua_tostring(luaState, i);
if (type == LuaTypes.LUA_TUSERDATA)
{
translator.getRawNetObject(luaState, i).ToString();
}
}
}
示例2: dumpStack
/// <summary>
/// Debug tool to dump the lua stack
/// </summary>
/// FIXME, move somewhere else
public static void dumpStack(ObjectTranslator translator, IntPtr luaState)
{
int depth = LuaDLL.lua_gettop(luaState);
Debug.WriteLine("lua stack depth: " + depth);
for (int i = 1; i <= depth; i++)
{
LuaTypes type = LuaDLL.lua_type(luaState, i);
// we dump stacks when deep in calls, calling typename while the stack is in flux can fail sometimes, so manually check for key types
string typestr = (type == LuaTypes.LUA_TTABLE) ? "table" : LuaDLL.lua_typename(luaState, type);
string strrep = LuaDLL.lua_tostring(luaState, i);
if (type == LuaTypes.LUA_TUSERDATA)
{
object obj = translator.getRawNetObject(luaState, i);
strrep = obj.ToString();
}
Debug.Print("{0}: ({1}) {2}", i, typestr, strrep);
}
}