本文整理汇总了C#中ILuaState.L_CheckInteger方法的典型用法代码示例。如果您正苦于以下问题:C# ILuaState.L_CheckInteger方法的具体用法?C# ILuaState.L_CheckInteger怎么用?C# ILuaState.L_CheckInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILuaState
的用法示例。
在下文中一共展示了ILuaState.L_CheckInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WidgetWriteOper
protected override bool WidgetWriteOper(ILuaState lua, string key)
{
switch (key)
{
case "type":
_normalInfo.type = lua.L_CheckInteger(-1);
break;
case "intensity":
_normalInfo.intensity = (float)lua.L_CheckNumber(-1);
break;
default:
return base.WidgetWriteOper(lua, key);
}
return true;
}
示例2: B_ArithShift
private static int B_ArithShift( ILuaState lua )
{
uint r = lua.L_CheckUnsigned( 1 );
int i = lua.L_CheckInteger( 2 );
if( i < 0 || ((r & ((uint)1 << (LUA_NBITS-1))) == 0) )
return B_Shift( lua, r, -i );
else // arithmetic shift for `nagetive' number
{
if( i>= LUA_NBITS )
r = ALLONES;
else
r = Trim((r >> i) | ~(~(uint)0 >> i)); // add signal bit
lua.PushUnsigned( r );
}
return 1;
}
示例3: WidgetWriteOper
/// //////////////////属性导出导入部分-有导入导出需求时重写///////////////////////////////////////////////
protected override bool WidgetWriteOper(ILuaState lua, string key)
{
switch (key)
{
case "dwType":
_normalInfo.type = lua.L_CheckInteger(-1);
break;
case "directColor":
_normalInfo.directColor = LuaExport.GetColor(lua, -1);
break;
case "amount":
_normalInfo.amount = (float)lua.L_CheckNumber(-1);
break;
case "bReset":
_normalInfo.bReset = lua.ToBoolean(-1);
break;
default:
return base.WidgetWriteOper(lua, key);
}
return true;
}
示例4: WidgetWriteOper
/// //////////////////属性导出导入部分-有导入导出需求时重写///////////////////////////////////////////////
protected override bool WidgetWriteOper(ILuaState lua, string key)
{
switch (key)
{
case "atlas":
_normalInfo.atlas = lua.L_CheckString(-1);
break;
case "sprite":
_normalInfo.sprite = lua.L_CheckString(-1);
break;
case "texture":
_normalInfo.texture = lua.L_CheckString(-1);
break;
case "localPosition":
_normalInfo.localPosition = LuaExport.GetVector3(lua, -1);
break;
case "size":
_normalInfo.size = LuaExport.GetVector2(lua, -1);
break;
case "depth":
_normalInfo.depth = lua.L_CheckInteger(-1);
break;
default:
return base.WidgetWriteOper(lua, key);
}
return true;
}
示例5: WidgetWriteOper
/// //////////////////属性导出导入部分-有导入导出需求时重写///////////////////////////////////////////////
protected override bool WidgetWriteOper(ILuaState lua, string key)
{
switch (key)
{
case "type":
_normalInfo.type = lua.L_CheckInteger(-1);
break;
case "localPosition":
_normalInfo.localPosition = LuaExport.GetVector3(lua, -1);
break;
default:
return base.WidgetWriteOper(lua, key);
}
return true;
}
示例6: Str_Sub
private static int Str_Sub( ILuaState lua )
{
string s = lua.L_CheckString(1);
int start = PosRelative( lua.L_CheckInteger(2), s.Length );
int end = PosRelative( lua.L_OptInt(3, -1), s.Length );
if( start < 1 ) start = 1;
if( end > s.Length ) end = s.Length;
if( start <= end )
lua.PushString( s.Substring(start-1, end-start+1) );
else
lua.PushString( "" );
return 1;
}
示例7: B_ToNumber
public static int B_ToNumber( ILuaState lua )
{
LuaType t = lua.Type( 2 );
if( t == LuaType.LUA_TNONE || t == LuaType.LUA_TNIL ) // standard conversion
{
bool isnum;
double n = lua.ToNumberX( 1, out isnum );
if( isnum )
{
lua.PushNumber( n );
return 1;
} // else not a number; must be something
lua.L_CheckAny( 1 );
}
else
{
string s = lua.L_CheckString( 1 );
int numBase = lua.L_CheckInteger( 2 );
bool negative = false;
lua.L_ArgCheck( (2 <= numBase && numBase <= 36), 2,
"base out of range" );
s = s.Trim( ' ', '\f', '\n', '\r', '\t', '\v' );
s = s + '\0'; // guard
int pos = 0;
if(s[pos] == '-') { pos++; negative = true; }
else if(s[pos] == '+') pos++;
if( Char.IsLetterOrDigit( s, pos ) )
{
double n = 0.0;
do
{
int digit;
if( Char.IsDigit( s, pos ) )
digit = Int32.Parse( s[pos].ToString() );
else
digit = Char.ToUpper( s[pos] ) - 'A' + 10;
if( digit >= numBase )
break; // invalid numeral; force a fail
n = n * (double)numBase + (double)digit;
pos++;
} while( Char.IsLetterOrDigit( s, pos ) );
if( pos == s.Length - 1 ) // except guard, no invalid trailing characters?
{
lua.PushNumber( negative ? -n : n );
return 1;
} // else not a number
} // else not a number
}
lua.PushNil(); // not a number
return 1;
}
示例8: TBL_Insert
private static int TBL_Insert( ILuaState lua )
{
int e = AuxGetN(lua, 1) + 1; // first empty element
int pos; // where to insert new element
switch( lua.GetTop() )
{
case 2: // called with only 2 arguments
{
pos = e; // insert new element at the end
break;
}
case 3:
{
pos = lua.L_CheckInteger(2); // 2nd argument is the position
if( pos > e ) e = pos; // `grow' array if necessary
for( int i=e; i>pos; --i ) // move up elements
{
lua.RawGetI( 1, i-1 );
lua.RawSetI( 1, i ); // t[i] = t[i-1]
}
break;
}
default:
{
return lua.L_Error( "wrong number of arguments to 'insert'" );
}
}
lua.RawSetI( 1, pos ); // t[pos] = v
return 0;
}
示例9: Lua_SetCullMask
int Lua_SetCullMask(ILuaState lua)
{
int dwMasx = lua.L_CheckInteger(2);
SetCullMask(dwMasx);
return 0;
}
示例10: B_RightRotate
private static int B_RightRotate( ILuaState lua )
{
return B_Rotate( lua, -lua.L_CheckInteger(2) );
}
示例11: B_RightShift
private static int B_RightShift( ILuaState lua )
{
return B_Shift( lua, lua.L_CheckUnsigned(1), -lua.L_CheckInteger(2) );
}
示例12: Lua_SetProjection
int Lua_SetProjection(ILuaState lua)
{
int t = lua.L_CheckInteger(2);
if (t == 1)
{
_camera.orthographic = true;
}
else
{
_camera.orthographic = false;
}
return 0;
}
示例13: FieldArgs
private static int FieldArgs( ILuaState lua, int farg, out int width )
{
int f = lua.L_CheckInteger( farg );
int w = lua.L_OptInt( farg+1, 1 );
lua.L_ArgCheck( 0 <= f, farg, "field cannot be nagetive" );
lua.L_ArgCheck( 0 < w, farg+1, "width must be positive" );
if( f + w > LUA_NBITS )
lua.L_Error( "trying to access non-existent bits" );
width = w;
return f;
}
示例14: Lua_SetRenderPath
int Lua_SetRenderPath(ILuaState lua)
{
RenderingPath path = (RenderingPath)lua.L_CheckInteger(2);
switch (path)
{
case RenderingPath.UsePlayerSettings:
case RenderingPath.VertexLit:
case RenderingPath.Forward:
case RenderingPath.DeferredLighting:
_camera.renderingPath = path;
break;
}
return 0;
}
示例15: Lua_SetDepth
int Lua_SetDepth(ILuaState lua)
{
int dwDepth = lua.L_CheckInteger(2);
SetDepth(dwDepth);
return 0;
}