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


C# ILuaState.NewTable方法代码示例

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


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

示例1: Lua_virtualPos

 int Lua_virtualPos(ILuaState lua)
 {
     float dis = (float)lua.L_CheckInteger(2);
     float lr = (float)lua.L_CheckInteger(3);
     float ud = (float)lua.L_CheckInteger(4);
     Vector3 vpos = virtualPos(dis, lr, ud);
     lua.NewTable();
     lua.PushNumber(vpos.x);
     lua.SetField(-2, "x");
     lua.PushNumber(vpos.y);
     lua.SetField(-2, "y");
     lua.PushNumber(vpos.z);
     lua.SetField(-2, "z");
     return 1;
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:15,代码来源:LuaGameCamera.cs

示例2: FFI_ParseSignature

 // return `ReturnType', `FuncName', `ParameterTypes'
 private static int FFI_ParseSignature( ILuaState lua )
 {
     var signature = lua.ToString(1);
     var result = FuncSignatureParser.Parse( lua, signature );
     if( result.ReturnType != null )
         lua.PushString( result.ReturnType );
     else
         lua.PushNil();
     lua.PushString( result.FuncName );
     if( result.ParameterTypes != null ) {
         lua.NewTable();
         for( int i=0; i<result.ParameterTypes.Length; ++i ) {
             lua.PushString( result.ParameterTypes[i] );
             lua.RawSetI( -2, i+1 );
         }
     }
     else {
         lua.PushNil();
     }
     return 3;
 }
开发者ID:matthewyang,项目名称:UniLua,代码行数:22,代码来源:LuaFFILib.cs

示例3: WidgetReadOper

        protected override bool WidgetReadOper(ILuaState lua, string key)
        {
            switch (key)
            {
                case "visible":
                    lua.PushBoolean(Visible);
                    return true;
                case "direction":
                    lua.PushNumber(GetDirection());
                    return true;
                case "type":
                    lua.PushInteger((int)GetEntityType());
                    return true;
                case "scale":
                    lua.PushNumber(transform.localScale.x);
                     return true;
                case "height":
                    lua.PushNumber(m_height);
                    return true;
                case "radius":
                    lua.PushNumber(m_Radius);
                    return true;
                case "highlightcolor":
                    lua.NewTable();
                     
                    lua.PushNumber(_highlightColor.r);
                    lua.SetField(-2,"r");

                    lua.PushNumber(_highlightColor.g);
                    lua.SetField(-2,"g");

                    lua.PushNumber(_highlightColor.b);
                    lua.SetField(-2,"b");

                    lua.PushNumber(_highlightColor.a);
                    lua.SetField(-2,"a");
                    return true;
            }

            return base.WidgetReadOper(lua, key);
        }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:41,代码来源:Entity.cs

示例4: WidgetReadOper

 protected override bool WidgetReadOper(ILuaState lua, string key)
 {
     switch (key)
     {
         case "type":
             lua.PushInteger((int)type);
             return true;
         case "depth":
             lua.PushInteger((int)_camera.depth);
             return true;
         case "distance":
             lua.PushNumber(m_normalInfo.distance);
             return true;
         case "parent":
             LuaObject pParent = transform.parent.GetComponent<LuaObject>();
             pParent.RefLua();
             pParent.PushThis(lua);
             return true;
         case "ml_target":
             LuaObject mpParent = ml_Target.GetComponent<LuaObject>();
             mpParent.RefLua();
             mpParent.PushThis(lua);
             return true;
         case "target":
             if (m_Target != null)
             {
                 LuaObject tar = m_Target.GetComponent<LuaObject>();
                 if (tar != null)
                     tar.PushThis(lua);
                 return true;
             }
             return false;
         case "LRAngle":
             lua.PushNumber(m_normalInfo.rotationLR);
             return true;
         case "UDAngle":
             lua.PushNumber(m_normalInfo.rotationUD);
             return true;
         case "offsetX":
             lua.PushNumber(m_normalInfo.offSet.x);
             return true;
         case "offsetY":
             lua.PushNumber(m_normalInfo.offSet.y);
             return true;
         case "offsetZ":
             lua.PushNumber(m_normalInfo.offSet.z);
             return true;
         case "offset":
             lua.NewTable();
             lua.PushNumber(m_normalInfo.offSet.x);
             lua.SetField(-2, "x");
             lua.PushNumber(m_normalInfo.offSet.y);
             lua.SetField(-2, "y");
             lua.PushNumber(m_normalInfo.offSet.z);
             lua.SetField(-2, "z");
             return true;
     }
     //return false;
     return base.WidgetReadOper(lua, key);
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:60,代码来源:LuaGameCamera.cs

示例5: 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

示例6: ExportProperty

 public virtual void ExportProperty(ILuaState lua, int index)
 {
     lua.NewTable();
     bool bSet = false;
     foreach (string key in expList)
     {
         bSet = WidgetReadOper(lua, key);
         if (bSet == true)
         {
             lua.SetField(-2, key);
         }
     }
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:13,代码来源:StoryBaseCtrl.cs

示例7: KeyframeToStack

 public static void KeyframeToStack(ILuaState lua, Keyframe keys)
 {
     lua.NewTable();
     lua.PushNumber(keys.time);
     lua.SetField(-2, "time");
     lua.PushNumber(keys.value);
     lua.SetField(-2, "value");
     lua.PushNumber(keys.inTangent);
     lua.SetField(-2, "inTangent");
     lua.PushNumber(keys.outTangent);
     lua.SetField(-2, "outTangent");
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:12,代码来源:LuaExport.cs

示例8: 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

示例9: NormalInfoToStack

 public static void NormalInfoToStack(ILuaState lua, normalInfo nor)
 {
     lua.NewTable();
     lua.PushNumber(nor.distance);
     lua.SetField(-2, "distance");
     lua.PushNumber(nor.rotationLR);
     lua.SetField(-2, "LRAngle");
     lua.PushNumber(nor.rotationUD);
     lua.SetField(-2, "UDAngle");
     Vector3ToStack(lua, nor.offSet);
     lua.SetField(-2, "offset");
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:12,代码来源:LuaExport.cs

示例10: ColorToStack

 public static void ColorToStack(ILuaState lua, Color cr)
 {
     lua.NewTable();
     lua.PushNumber(cr.r);
     lua.SetField(-2, "r");
     lua.PushNumber(cr.g);
     lua.SetField(-2, "g");
     lua.PushNumber(cr.b);
     lua.SetField(-2, "b");
     lua.PushNumber(cr.a);
     lua.SetField(-2, "a");
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:12,代码来源:LuaExport.cs

示例11: QuaternionToStack

 public static void QuaternionToStack(ILuaState lua, Quaternion qat)
 {
     lua.NewTable();
     lua.PushNumber(qat.x);
     lua.SetField(-2, "x");
     lua.PushNumber(qat.y);
     lua.SetField(-2, "y");
     lua.PushNumber(qat.z);
     lua.SetField(-2, "z");
     lua.PushNumber(qat.w);
     lua.SetField(-2, "w");
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:12,代码来源:LuaExport.cs

示例12: Vector3ToStack

 public static void Vector3ToStack(ILuaState lua, Vector3 v3)
 {
     lua.NewTable();
     lua.PushNumber(v3.x);
     lua.SetField(-2, "x");
     lua.PushNumber(v3.y);
     lua.SetField(-2, "y");
     lua.PushNumber(v3.z);
     lua.SetField(-2, "z");
 }
开发者ID:cedar-x,项目名称:unilua_story,代码行数:10,代码来源:LuaExport.cs

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