本文整理汇总了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;
}
示例2: B_Next
public static int B_Next( ILuaState lua )
{
lua.SetTop( 2 );
if( lua.Next(1) )
{
return 2;
}
else
{
lua.PushNil();
return 1;
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
//.........这里部分代码省略.........
示例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;
}
示例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;
}