本文整理汇总了C#中ILuaState.L_CheckNumber方法的典型用法代码示例。如果您正苦于以下问题:C# ILuaState.L_CheckNumber方法的具体用法?C# ILuaState.L_CheckNumber怎么用?C# ILuaState.L_CheckNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILuaState
的用法示例。
在下文中一共展示了ILuaState.L_CheckNumber方法的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: WidgetWriteOper
protected override bool WidgetWriteOper(ILuaState lua, string key)
{
switch (key)
{
case "spName":
_normalInfo.spName = lua.L_CheckString(-1);
break;
case "distance":
_normalInfo.distance = (float)lua.L_CheckNumber(-1);
break;
default:
return base.WidgetWriteOper(lua, key);
}
return true;
}
示例3: Math_Atan
private static int Math_Atan( ILuaState lua )
{
lua.PushNumber( Math.Atan( lua.L_CheckNumber(1) ) );
return 1;
}
示例4: Math_Sqrt
private static int Math_Sqrt( ILuaState lua )
{
lua.PushNumber( Math.Sqrt( lua.L_CheckNumber(1) ) );
return 1;
}
示例5: Math_Rad
private static int Math_Rad( ILuaState lua )
{
lua.PushNumber( lua.L_CheckNumber(1) * RADIANS_PER_DEGREE );
return 1;
}
示例6: Math_Modf
private static int Math_Modf( ILuaState lua )
{
double d = lua.L_CheckNumber(1);
double c = Math.Ceiling(d);
lua.PushNumber( c );
lua.PushNumber( d-c );
return 2;
}
示例7: Math_Log
private static int Math_Log( ILuaState lua )
{
double x = lua.L_CheckNumber(1);
double res;
if( lua.IsNoneOrNil(2) )
res = Math.Log(x);
else
{
double logBase = lua.L_CheckNumber(2);
if( logBase == 10.0 )
res = Math.Log10(x);
else
res = Math.Log(x, logBase);
}
lua.PushNumber(res);
return 1;
}
示例8: Math_Ldexp
private static int Math_Ldexp( ILuaState lua )
{
lua.PushNumber( lua.L_CheckNumber(1) * Math.Pow(2, lua.L_CheckNumber(2)) );
return 1;
}
示例9: WidgetWriteOper
/// //////////////////属性导出导入部分-有导入导出需求时重写///////////////////////////////////////////////
protected override bool WidgetWriteOper(ILuaState lua, string key)
{
switch (key)
{
case "musicName":
_normalInfo.musicName = lua.L_CheckString(-1);
break;
case "volume":
_normalInfo.volume = (float)lua.L_CheckNumber(-1);
break;
case "bLoop":
_normalInfo.bLoop = lua.ToBoolean(-1);
break;
default:
return base.WidgetWriteOper(lua, key);
}
return true;
}
示例10: Lua_SetPosition
int Lua_SetPosition(ILuaState lua)
{
float x = (float)lua.L_CheckNumber(2);
float y = (float)lua.L_CheckNumber(3);
float z = (float)lua.L_CheckNumber(4);
SetPosition(x, y,z);
return 0;
}
示例11: Lua_PlaySound
int Lua_PlaySound(ILuaState lua)
{
string name = lua.L_CheckString(2);
float fDelay = 0;
if (lua.Type(3) == LuaType.LUA_TNUMBER)
{
fDelay = (float)lua.L_CheckNumber(3);
}
var audio = PlaySound(name, fDelay);
if (audio != null)
{
audio.PushThis(lua);
return 1;
}
return 0;
}
示例12: WidgetWriteOper
protected override bool WidgetWriteOper(ILuaState lua, string key)
{
switch (key)
{
case "visible":
Visible = lua.ToBoolean(3);
return true;
case "direction":
SetDirection((float)lua.L_CheckNumber(3));
return true;
case "type":
SetEntityType((EntityType)lua.L_CheckInteger(3));
return true;
case "scale":
SetLocalScale((float)lua.L_CheckNumber(3));
return true;
case "highlightcolor":
if (lua.Type(3) != LuaType.LUA_TTABLE)
{
Debug.LogWarning("Entity hightlightcolor attribute parm table excepted.");
return true;
}
lua.GetField(3, "r");
_highlightColor.r = (float)lua.L_CheckNumber(-1);
lua.Pop(1);
lua.GetField(3, "g");
_highlightColor.g = (float)lua.L_CheckNumber(-1);
lua.Pop(1);
lua.GetField(3, "b");
_highlightColor.b = (float)lua.L_CheckNumber(-1);
lua.Pop(1);
lua.GetField(3, "a");
//_highlightColor.a = (float)lua.L_CheckNumber(-1);
float a = (float)lua.L_CheckNumber(-1);
lua.Pop(1);
//print("***** Entity highlight color " + _highlightColor);
return true;
}
return base.WidgetWriteOper(lua, key);
}
示例13: 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;
}
示例14: WidgetWriteOper
protected virtual bool WidgetWriteOper(ILuaState lua, string key)
{
int dwStackIndex = lua.GetTop();
switch (key)
{
case "event":
break;
case "time":
time = (float)lua.L_CheckNumber(-1);
break;
case "bWait":
bWait = lua.ToBoolean(-1);
break;
case "bClick":
bClick = lua.ToBoolean(-1);
break;
default:
return false;
}
if (dwStackIndex != lua.GetTop())
Debug.LogWarning("StoryBaseCtrl:WidgetWriteOper stack Exception:start=" + key + ":" + dwStackIndex + " end=" + lua.GetTop());
return true;
}
示例15: Math_Fmod
private static int Math_Fmod( ILuaState lua )
{
lua.PushNumber( Math.IEEERemainder( lua.L_CheckNumber(1),
lua.L_CheckNumber(2)));
return 1;
}