Exemplo n.º 1
0
    static int GetMotorTorque(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        WheelJoint2D obj  = LuaScriptMgr.GetNetObject <WheelJoint2D>(L, 1);
        float        arg0 = (float)LuaScriptMgr.GetNumber(L, 2);
        float        o    = obj.GetMotorTorque(arg0);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
    public static int GetMotorTorque(IntPtr l)
    {
        int result;

        try
        {
            WheelJoint2D wheelJoint2D = (WheelJoint2D)LuaObject.checkSelf(l);
            float        timeStep;
            LuaObject.checkType(l, 2, out timeStep);
            float motorTorque = wheelJoint2D.GetMotorTorque(timeStep);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, motorTorque);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }