本文整理汇总了C#中ILuaState.IsNoneOrNil方法的典型用法代码示例。如果您正苦于以下问题:C# ILuaState.IsNoneOrNil方法的具体用法?C# ILuaState.IsNoneOrNil怎么用?C# ILuaState.IsNoneOrNil使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILuaState
的用法示例。
在下文中一共展示了ILuaState.IsNoneOrNil方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: lua_Stop
private int lua_Stop(ILuaState lua)
{
if (lua.IsNone (2)) {
iTween.Stop();
}
LuaObject luaObj = LuaObject.GetLuaObject (lua, 2);
if (luaObj == null) {
Debug.Log ("this luaobj is nil ");
return 0;
} else if (lua.IsNoneOrNil (3) && lua.IsNoneOrNil (4)) {
iTween.Stop (luaObj.gameObject);
} else if (!lua.IsNoneOrNil (3) && lua.IsNoneOrNil (4)) {
string szType = lua.L_CheckString (3);
iTween.Stop (luaObj.gameObject,szType);
} else if (lua.IsNoneOrNil (3) && !lua.IsNoneOrNil (4)) {
bool isIncludeChild = lua.ToBoolean(4);
iTween.Stop(luaObj.gameObject,isIncludeChild);
}
return 0;
}
示例2: Traceback
private static int Traceback(ILuaState lua)
{
var msg = lua.ToString(1);
if(msg != null) {
lua.L_Traceback(lua, msg, 1);
}
// is there an error object?
else if(!lua.IsNoneOrNil(1)) {
// try its `tostring' metamethod
if(!lua.L_CallMeta(1, "__tostring")) {
lua.PushString("(no error message)");
}
}
return 1;
}
示例3: 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;
}
示例4: TBL_Sort
private static int TBL_Sort( ILuaState lua )
{
int n = AuxGetN(lua, 1);
lua.L_CheckStack(40, ""); /* assume array is smaller than 2^40 */
if (!lua.IsNoneOrNil(2)) /* is there a 2nd argument? */
lua.L_CheckType( 2, LuaType.LUA_TFUNCTION );
lua.SetTop(2); /* make sure there is two arguments */
AuxSort(lua, 1, n);
return 0;
}
示例5: Lua_LookAt
int Lua_LookAt(ILuaState lua)
{
if (!lua.IsNoneOrNil (4))
{
return Lua_LookAtWithPos(lua);
}
LuaObject pLuaTarget = LuaObject.GetLuaObject(lua,2);
if(pLuaTarget == null)
return 0;
Transform pTarget = pLuaTarget.transform;
_camera.transform.LookAt(pTarget.position);
return 0;
}
示例6: lua_CameraFadeAdd
private int lua_CameraFadeAdd(ILuaState lua)
{
if (lua.IsNoneOrNil (2)) {
iTween.CameraFadeAdd();
return 0;
}
string szImage = lua.L_CheckString (2);
Texture2D texture = (Texture2D)Resources.Load("Images/"+ szImage);
if (texture != null) {
iTween.CameraFadeAdd (texture);
} else {
iTween.CameraFadeAdd();
}
return 0;
}