当前位置: 首页>>代码示例>>C#>>正文


C# ILuaState.IsNoneOrNil方法代码示例

本文整理汇总了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;
		}
开发者ID:cedar-x,项目名称:unilua_story,代码行数:20,代码来源:LuaItween.cs

示例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;
 }
开发者ID:Jornason,项目名称:UniLua,代码行数:15,代码来源:LuaScriptController.cs

示例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;
		}
开发者ID:Jornason,项目名称:UniLua,代码行数:17,代码来源:LuaMathLib.cs

示例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;
		}
开发者ID:jaydenh,项目名称:UniLua,代码行数:10,代码来源:LuaTableLib.cs

示例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;
		}
开发者ID:cedar-x,项目名称:unilua_story,代码行数:13,代码来源:LuaCamera.cs

示例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;
		}
开发者ID:cedar-x,项目名称:unilua_story,代码行数:17,代码来源:LuaItween.cs


注:本文中的ILuaState.IsNoneOrNil方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。