本文整理汇总了C#中ILuaState.Error方法的典型用法代码示例。如果您正苦于以下问题:C# ILuaState.Error方法的具体用法?C# ILuaState.Error怎么用?C# ILuaState.Error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILuaState
的用法示例。
在下文中一共展示了ILuaState.Error方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: B_DoFile
public static int B_DoFile( ILuaState lua )
{
string filename = lua.L_OptString( 1, null );
lua.SetTop( 1 );
if( lua.L_LoadFile( filename ) != ThreadStatus.LUA_OK )
lua.Error();
lua.CallK( 0, LuaDef.LUA_MULTRET, 0, DoFileContinuation );
return DoFileContinuation( lua );
}
示例2: B_Error
public static int B_Error( ILuaState lua )
{
int level = lua.L_OptInt( 2, 1 );
lua.SetTop( 1 );
if( lua.IsString( 1 ) && level > 0 )
{
lua.L_Where( level );
lua.PushValue( 1 );
lua.Concat( 2 );
}
return lua.Error();
}
示例3: CO_AuxWrap
private static int CO_AuxWrap( ILuaState lua )
{
ILuaState co = lua.ToThread( lua.UpvalueIndex(1) );
int r = AuxResume( lua, co, lua.GetTop() );
if( r < 0 )
{
if( lua.IsString( -1 ) ) // error object is a string?
{
lua.L_Where( 1 ); // add extra info
lua.Insert( -2 );
lua.Concat( 2 );
}
lua.Error();
}
return r;
}
示例4: FFI_CallMethod
private static int FFI_CallMethod( ILuaState lua )
{
var ffiMethod = (FFIMethodBase)lua.ToUserData(1);
if (ffiMethod != null)
{
try
{
return ffiMethod.Call(lua);
}
catch( Exception e )
{
lua.PushString( "call_method Exception: " + e.Message +
"\nSource:\n" + e.Source +
"\nStaceTrace:\n" + e.StackTrace );
lua.Error();
return 0;
}
}
else
{
lua.PushString( "call_method cannot find MethodInfo" );
lua.Error();
return 0;
}
}
示例5: pushargs
/*
** Push on the stack the contents of table 'arg' from 1 to #arg
*/
static int pushargs(ILuaState L)
{
int i, n;
if (L.GetGlobal("arg") != LuaType.Table)
L.Error("'arg' is not a table");
n = L.LLen(-1);
L.CheckStack(n + 3, "too many arguments to script");
for (i = 1; i <= n; i++)
L.RawGetI(-i, i);
L.Remove(-i); /* remove table from the stack */
return n;
}
示例6: lstop
/*
** Hook set by signal function to stop the interpreter.
*/
static void lstop(ILuaState L, LuaDebug ar)
{
//(void)ar; /* unused arg. */
L.SetHook(null, 0, 0); /* reset hook */
L.Error("interrupted!");
}