本文整理汇总了C#中ILuaState.RawLen方法的典型用法代码示例。如果您正苦于以下问题:C# ILuaState.RawLen方法的具体用法?C# ILuaState.RawLen怎么用?C# ILuaState.RawLen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILuaState
的用法示例。
在下文中一共展示了ILuaState.RawLen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMethodAux
private static int GetMethodAux( ILuaState lua, BindingFlags flags )
{
var t = (Type)lua.ToUserData(1);
var mname = lua.ToString(2);
var n = lua.RawLen(3);
var types = new Type[n];
for( int i=0; i<n; ++i )
{
lua.RawGetI( 3, i+1 );
types[i] = (Type)lua.ToUserData(-1);
lua.Pop(1);
}
var minfo = t.GetMethod( mname,
flags,
null,
CallingConventions.Any,
types,
null
);
if( minfo == null )
{
return 0;
}
else
{
var ffiMethod = new FFIMethodInfo(minfo);
lua.PushLightUserData( ffiMethod );
return 1;
}
}
示例2: B_RawLen
public static int B_RawLen( ILuaState lua )
{
LuaType t = lua.Type( 1 );
lua.L_ArgCheck( t == LuaType.LUA_TTABLE || t == LuaType.LUA_TSTRING,
1, "table or string expected" );
lua.PushInteger( lua.RawLen( 1 ) );
return 1;
}
示例3: FFI_GetConstructor
private static int FFI_GetConstructor( ILuaState lua )
{
var t = (Type)lua.ToUserData(1);
var n = lua.RawLen(2);
var types = new Type[n];
for( int i=0; i<n; ++i )
{
lua.RawGetI( 2, i+1 );
types[i] = (Type)lua.ToUserData(-1);
lua.Pop( 1 );
}
var cinfo = t.GetConstructor( types );
var ffiMethod = new FFIConstructorInfo(cinfo);
lua.PushLightUserData( ffiMethod );
return 1;
}