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


C# ILuaState.Next方法代码示例

本文整理汇总了C#中ILuaState.Next方法的典型用法代码示例。如果您正苦于以下问题:C# ILuaState.Next方法的具体用法?C# ILuaState.Next怎么用?C# ILuaState.Next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILuaState的用法示例。


在下文中一共展示了ILuaState.Next方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TBL_MaxN

		private static int TBL_MaxN( ILuaState lua )
		{
			double max = 0.0;
			lua.L_CheckType( 1, LuaType.LUA_TTABLE );

			lua.PushNil(); // first key
			while( lua.Next(1) )
			{
				lua.Pop( 1 ); // remove value
				if( lua.Type( -1 ) == LuaType.LUA_TNUMBER ) {
					double v = lua.ToNumber( -1 );
					if( v > max ) max = v;
				}
			}
			lua.PushNumber( max );
			return 1;
		}
开发者ID:jaydenh,项目名称:UniLua,代码行数:17,代码来源:LuaTableLib.cs

示例2: B_Next

 public static int B_Next( ILuaState lua )
 {
     lua.SetTop( 2 );
     if( lua.Next(1) )
     {
         return 2;
     }
     else
     {
         lua.PushNil();
         return 1;
     }
 }
开发者ID:matthewyang,项目名称:UniLua,代码行数:13,代码来源:LuaBaseLib.cs

示例3: ImportProperty

 public void ImportProperty(ILuaState lua, int index)
 {
     lua.PushValue(index);
     lua.PushNil();
     while(lua.Next(-2))
     {
         int key = lua.L_CheckInteger(-2);
         StoryShotCtrl shotctrl = _shots[key-1];
         shotctrl.ImportProperty(lua, -1);
         lua.Pop(1);
     }
     lua.Pop(1);
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:13,代码来源:StoryBoardCtrl.cs

示例4: Lua_UseParam

 int Lua_UseParam(ILuaState lua)
 {
     if (lua.Type(2) != LuaType.LUA_TTABLE)
     {
         Debug.LogWarning("Lua Game Camera UseParam parm table excepted.");
         return 0;
     }
     lua.PushNil();
     while (lua.Next(-2))
     {
         string key = lua.L_CheckString(-2);
         switch (key)
         {
             case "distance":
                 m_normalInfo.distance = (float)lua.L_CheckNumber(-1);
                 break;
             case "offset":
                 m_normalInfo.offSet = LuaItween.GetVector3(lua, -1);
                 break;
             case "LRAngle":
                 m_normalInfo.rotationLR = (float)lua.L_CheckNumber(-1);
                 break;
             case "UDAngle":
                 m_normalInfo.rotationUD = (float)lua.L_CheckNumber(-1);
                 break;
             default:
                 break;
         }
         lua.Pop(1);
     }
     lua.Pop(1);
     return 0;
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:33,代码来源:LuaGameCamera.cs

示例5: ImportProperty

 public virtual void ImportProperty(ILuaState lua, int index)
 {
     bool bFlag = false;
     lua.PushValue(index);
     lua.PushNil();
     while (lua.Next(-2))
     {
         string key = lua.L_CheckString(-2);
         bFlag = WidgetWriteOper(lua, key);
         if (bFlag == false)
             Debug.LogWarning(luaName + " can't write key:" + key + " please check....");
         lua.Pop(1);
     }
     lua.Pop(1);
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:15,代码来源:StoryBaseCtrl.cs

示例6: MoveControllerAdaptHasHTable

        // zsy add
        private Hashtable MoveControllerAdaptHasHTable(ILuaState lua)
        {
            LuaObjWithCallFun callBackFun = new LuaObjWithCallFun();
            //print("*********** state len" + lua.GetTop());
            Hashtable hashTable = new Hashtable();
            lua.PushValue(3);
            lua.PushNil();
            while (lua.Next(-2))
            {
                string key = lua.L_CheckString(-2);
                switch (key)
                {
                    case "animation":
                        {
                            Hashtable animation = new Hashtable();
                            lua.PushValue(-1);
                            lua.PushNil();

                            float value = 0;
                            string strtype = "ease";
                            bool blean = true;

                            while (lua.Next(-2))
                            {
                                string childkey = lua.L_CheckString(-2);
                                switch (childkey)
                                {
                                    case "onstart":
                                        {
                                            if (lua.Type(-1) == LuaType.LUA_TFUNCTION)
                                            {
                                                lua.PushValue(-1);
                                                callBackFun.dwStartFun = lua.L_Ref(LuaDef.LUA_REGISTRYINDEX);
                                                animation.Add(childkey, childkey);
                                            }
                                            break;
                                        }
                                    case "onupdate":
                                        {
                                            if (lua.Type(-1) == LuaType.LUA_TFUNCTION)
                                            {
                                                lua.PushValue(-1);
                                                callBackFun.dwUpdateFun = lua.L_Ref(LuaDef.LUA_REGISTRYINDEX);

                                                animation.Add(childkey, childkey);
                                            }
                                            break;
                                        }
                                    case "oncomplete":
                                        {
                                            if (lua.Type(-1) == LuaType.LUA_TFUNCTION)
                                            {
                                                lua.PushValue(-1);
                                                callBackFun.dwConpleteFun = lua.L_Ref(LuaDef.LUA_REGISTRYINDEX);

                                                animation.Add(childkey, childkey);
                                            }
                                            break;
                                        }

                                    default:
                                        switch (lua.Type(-1))
                                        {
                                            case LuaType.LUA_TNUMBER:
                                                value = (float)lua.L_CheckNumber(-1);
                                                animation.Add(childkey, value);
                                                break;
                                            case LuaType.LUA_TBOOLEAN:
                                                blean = lua.ToBoolean(-1);
                                                animation.Add(childkey, blean);
                                                break;
                                            case LuaType.LUA_TSTRING:
                                                strtype = lua.L_CheckString(-1);
                                                animation.Add(childkey, strtype);
                                                break;
                                            default:
                                                break;
                                        }
                                        break;
                                }
                                
                                lua.Pop(1);
                            }
                            lua.Pop(1);

                            if (callBackFun.dwConpleteFun != 0)
                            {
                                animation.Add("oncompleteparams", callBackFun);
                            }
                            if (callBackFun.dwStartFun != 0)
                            {
                                animation.Add("onstartparams", callBackFun);
                            }
                            if (callBackFun.dwUpdateFun != 0)
                            {
                                animation.Add("onupdateparams", callBackFun);
                            }

                            animation.Add("onstarttarget", gameObject);
//.........这里部分代码省略.........
开发者ID:cedar-x,项目名称:unilua_story,代码行数:101,代码来源:LuaItween.cs

示例7: ItweenParamHasHTable

        static public Hashtable ItweenParamHasHTable(ILuaState lua, LuaObjWithCallFun callBackFun)
        {
            Hashtable hashTable = new Hashtable();
			lua.PushNil ();
			while (lua.Next(-2)) {
				string key = lua.L_CheckString(-2);
				switch(key)
				{
				case "path":
				{
					Vector3[] path = GetPath(lua,-1);
					hashTable.Add(key,path);
					break;
				}
				case "rotation":
				case "position":
				case "looktarget":
				//case "amount":
				case "scale":
				{
					Vector3  transfrom = GetVector3(lua,-1);
					hashTable.Add(key,transfrom);
					break;
				}
				case "movetopath":
				case "islocal":
				{		
					bool bIsLocal = false;
					if( lua.Type(-1) == LuaType.LUA_TBOOLEAN){
						 bIsLocal = lua.ToBoolean(-1);
					}
					hashTable.Add(key,bIsLocal);
					break;
				}
				case "easetype":
				{
					iTween.EaseType value = (iTween.EaseType)lua.L_CheckInteger(-1);
					hashTable.Add(key,value);
					break;
				}
				case "LoopType":
				{
					iTween.LoopType value = (iTween.LoopType)lua.L_CheckInteger(-1);
					hashTable.Add(key,value);
					break;
				}
				case "onstart":
				{
					if(lua.Type(-1) == LuaType.LUA_TFUNCTION)
					{
						lua.PushValue(-1);
						callBackFun.dwStartFun = lua.L_Ref(LuaDef.LUA_REGISTRYINDEX);
						string value = key;
						hashTable.Add(key,value);
					}
					break;
				}
				case "onupdate":
				{
					if(lua.Type(-1) == LuaType.LUA_TFUNCTION)
					{
						lua.PushValue(-1);
						callBackFun.dwUpdateFun = lua.L_Ref(LuaDef.LUA_REGISTRYINDEX);
						string value = key;
						hashTable.Add(key,value);
					}
					break;
				}
				case "oncomplete":
				{
					if(lua.Type(-1) == LuaType.LUA_TFUNCTION)
					{
						lua.PushValue(-1);
						callBackFun.dwConpleteFun = lua.L_Ref(LuaDef.LUA_REGISTRYINDEX);
						string value = key;
						hashTable.Add(key,value);
					}
					break;
				}
				case "onstarttarget":
				case "onupdatetarget":
				case "oncompletetarget":
                {
					break;
				}

				
				default:
				{
					float value = (float)lua.L_CheckNumber(-1);
					hashTable.Add(key,value);
					break;
				}
					
				}
				lua.Pop(1);
			}
			lua.Pop(1);
            return hashTable;
        }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:100,代码来源:LuaItween.cs

示例8: GetStringArray

    public static List<string> GetStringArray(ILuaState lua, int tbIndex)
    {
        if (lua.Type(tbIndex) != LuaType.LUA_TTABLE)
        {
            return null;
        }

        List<string> arrays = null;
        lua.PushValue(tbIndex);
        lua.PushNil();
        while (lua.Next(-2))
        {
            if (lua.Type(-1) == LuaType.LUA_TSTRING)
            {
                if (arrays == null)
                    arrays = new List<string>();

                arrays.Add(lua.ToString(-1));
            }
            lua.Pop(1);
        }
        lua.Pop(1);

        return arrays;
    }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:25,代码来源:LuaContex.cs


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