Exemplo n.º 1
0
        public void SetDebugInput(VehicleEntity vehicle, VechileDebugInput inputType, float value)
        {
            var controller = GetController(vehicle);

            switch (inputType)
            {
            case VechileDebugInput.Throttle:
                controller.throttleInput = value;
                break;

            case VechileDebugInput.Steer:
                controller.steerInput = value;
                break;

            case VechileDebugInput.Brake:
                controller.brakeInput = value;
                break;

            case VechileDebugInput.HandBrake:
                controller.handbrakeInput = value;
                break;
            }

            if (!controller.throttleInput.Equals(0))
            {
                controller.DisableSleeping = false;
            }
            else
            {
                controller.DisableSleeping = true;
            }
        }
Exemplo n.º 2
0
        private static void SetVehicleInput(VehicleContext context, int id, VechileDebugInput inputType, float val)
        {
            var vehicle = GetVehicle(context, id);

            if (vehicle != null)
            {
                vehicle.SetDebugInput(inputType, val);
            }
        }
Exemplo n.º 3
0
 public static void SetDebugInput(this VehicleEntity vehicle, VechileDebugInput inputType, float value)
 {
     EntityAPI[vehicle.GetTypeValue()].SetDebugInput(vehicle, inputType, value);
 }