Пример #1
0
        public void Debug(Car car)
        {
            var carBody = (Body)Extensions.GetPrivateField(car, "_body");
            _json.SetName(carBody, "Car");
            _json.SetName(carBody.FixtureList[0], "CarCollision");
            _json.SetName(carBody.FixtureList[1], "CarSprite");
            var wheels = (Wheel[])Extensions.GetPrivateField(car, "_wheels");
            _json.SetName(wheels[0].Body, "WheelBackLeft");
            _json.SetName(wheels[0].Body.FixtureList[0], "WheelBackLeft");
            _json.SetName(wheels[1].Body, "WheelBackRight");
            _json.SetName(wheels[1].Body.FixtureList[0], "WheelBackRight");
            _json.SetName(wheels[2].Body, "WheelFrontLeft");
            _json.SetName(wheels[2].Body.FixtureList[0], "WheelFrontLeft");
            _json.SetName(wheels[3].Body, "WheelFrontRight");
            _json.SetName(wheels[3].Body.FixtureList[0], "WheelFrontRight");

            _json.SetName((Joint)Extensions.GetPrivateField(car, "_backLeftJoint"), "BackLeftJoint");
            _json.SetName((Joint)Extensions.GetPrivateField(car, "_backRightJoint"), "BackRightJoint");
            _json.SetName((Joint)Extensions.GetPrivateField(car, "_frontLeftJoint"), "FrontLeftJoint");
            _json.SetName((Joint)Extensions.GetPrivateField(car, "_frontRightJoint"), "FrontRightJoint");

            SaveWorld("GTA2NET.json");
        }
Пример #2
0
 public void AddObject(Car car)
 {
     var widthInBlockUnits = ConvertUnits.ToBlockUnits(car.CarInfo.Width);
     var heightInBlockUnits = ConvertUnits.ToBlockUnits(car.CarInfo.Height);
     car.CreateBody(_world, widthInBlockUnits, heightInBlockUnits);
 }