コード例 #1
0
    static int GetMotorTorque(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        HingeJoint2D obj  = LuaScriptMgr.GetNetObject <HingeJoint2D>(L, 1);
        float        arg0 = (float)LuaScriptMgr.GetNumber(L, 2);
        float        o    = obj.GetMotorTorque(arg0);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
コード例 #2
0
    public static int GetMotorTorque(IntPtr l)
    {
        int result;

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