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


C# ILuaState.SetTable方法代码示例

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


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

示例1: AnimationCurveToStack

 public static void AnimationCurveToStack(ILuaState lua, AnimationCurve aniCurve)
 {
     lua.NewTable();
     for (int i = 0; i < aniCurve.keys.Length;i++ )
     {
         lua.PushNumber(i+1);
         Keyframe key = aniCurve.keys[i];
         KeyframeToStack(lua, key);
         lua.SetTable(-3);
     }
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:11,代码来源:LuaExport.cs

示例2: WidgetReadOper

        protected override bool WidgetReadOper(ILuaState lua, string key)
        {
            switch (key)
            {
                case "speedArr"://lsy add
                    //Debug.Log("-----------SPEED------READ-----------");
                    CameraPathSpeedList slist = _cameraPath.speedList;
                    lua.NewTable();
                    for (int i = 1; i <= slist.realNumberOfPoints; i++)
                    {     
                        CameraPathSpeed spd = slist[i - 1];
                        lua.PushNumber(i);
                        lua.NewTable();

                        lua.PushInteger((int)spd.positionModes);
                        lua.SetField(-2, "positionModes");//free or FixedToPoint

                        lua.PushNumber(spd.percent);
                        lua.SetField(-2, "percent");

                        lua.PushNumber(spd.speed);
                        lua.SetField(-2, "speed");

                        lua.PushNumber(spd.curvePercentage);
                        lua.SetField(-2, "curvePercentage");
                        if (spd.point != null)
                        {
                            lua.PushInteger(spd.point.index);
                            lua.SetField(-2, "point");
                        }    
                        if (spd.cpointA != null)
                        {
                            lua.PushInteger(spd.cpointA.index);
                            lua.SetField(-2, "cpointA");
                        }
                        if (spd.cpointB != null)
                        {
                            lua.PushInteger(spd.cpointB.index);
                            lua.SetField(-2, "cpointB");
                        }
                     
                        lua.SetTable(-3);
                    }
                    break;
                case "isLoop"://
                    lua.PushBoolean(_cameraPath.loop);
                    break;
                case "dwType":
                    lua.PushInteger(2);
                    break;
                case "interpolation":
                    lua.PushInteger((int)_cameraPath.interpolation);
                    break;
                case "animMode":
                    lua.PushInteger((int)_cameraAnimator.animationMode);
                    break;
                case "speed":
                    lua.PushNumber(_cameraAnimator.pathSpeed);
                    break;
                case "controlpoints":
                    lua.NewTable();
                    for (int i = 1; i <= _cameraPath.realNumberOfPoints; i++)
                    {
                        lua.PushNumber(i);
                        lua.NewTable();
                        Vector3ToStack(lua, _cameraPath[i-1].localPosition);
                        lua.SetField(-2, "controlpoint");
                        Vector3ToStack(lua, _cameraPath[i - 1].forwardControlPoint);
                        lua.SetField(-2, "forwardControlPoint");
                        Vector3ToStack(lua, _cameraPath[i - 1].backwardControlPoint);
                        lua.SetField(-2, "backwardControlPoint");
                        lua.SetTable(-3);
                    }
                    break;
                case "Orientations":
                    CameraPathOrientationList ori = _cameraPath.orientationList;
                    lua.NewTable();
                    for (int i = 1; i <= ori.realNumberOfPoints; i++)
                    {
                        CameraPathOrientation pathOri = ori[i-1];
                        lua.PushNumber(i);
                        QuaternionToStack(lua, pathOri.rotation);
                        lua.PushInteger((int)pathOri.positionModes);
                        lua.SetField(-2, "positionModes");
                        lua.PushNumber(pathOri.percent);
                        lua.SetField(-2, "percent");
                        lua.PushNumber(pathOri.curvePercentage);
                        lua.SetField(-2, "curvePercentage");
                        
                        if (pathOri.point != null)
                        {
                            lua.PushInteger(pathOri.point.index);
                            lua.SetField(-2, "point");
                        }
                        if (pathOri.cpointA != null)
                        {
                            lua.PushInteger(pathOri.cpointA.index);
                            lua.SetField(-2, "cpointA");
                        }
                        if (pathOri.cpointB != null)
//.........这里部分代码省略.........
开发者ID:cedar-x,项目名称:unilua_story,代码行数:101,代码来源:LuaPathCamera.cs

示例3: Lua_GetTimeInfo

	private int Lua_GetTimeInfo(ILuaState lua)
	{
		double v = lua.L_CheckNumber(1);
		DateTime date = _utcOrigin.AddMilliseconds(v + (3600 * 8 * 1000) );
        
		lua.NewTable();
		lua.PushString("year");
		lua.PushInteger(date.Year);
		lua.SetTable(-3);

		lua.PushString("month");
		lua.PushInteger(date.Month);
		lua.SetTable(-3);

		lua.PushString("day");
		lua.PushInteger(date.Day);
		lua.SetTable(-3);

		lua.PushString("hour");
		lua.PushInteger(date.Hour);
		lua.SetTable(-3);

		lua.PushString("minute");
		lua.PushInteger(date.Minute);
		lua.SetTable(-3);

		lua.PushString("second");
		lua.PushInteger(date.Second);
		lua.SetTable(-3);

        lua.PushString("wday");
        lua.PushInteger((int)date.DayOfWeek);
        lua.SetTable(-3);

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


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