DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnSound()

override float Offroad_02::OnSound ( CarSoundCtrl ctrl,
float oldValue )
inlineprotected

См. определение в файле Vehicles/InheritedCars/Offroad_02.c строка 327

328 {
329 switch ( ctrl )
330 {
331 case CarSoundCtrl.DOORS:
332 float newValue = 0;
333 if (GetCarDoorsState("Offroad_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
334 {
335 newValue += 0.25;
336 }
337
338 if (GetCarDoorsState("Offroad_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
339 {
340 newValue += 0.25;
341 }
342
343 if (GetCarDoorsState("Offroad_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
344 {
345 newValue += 0.25;
346 }
347
348 if (GetCarDoorsState("Offroad_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
349 {
350 newValue += 0.25;
351 }
352
353 return Math.Clamp(newValue, 0, 1);
354 break;
355 }
356
357 return super.OnSound(ctrl, oldValue);
358 }
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
Определения Car.c:4
CarDoorState
Определения CarScript.c:2
override int GetCarDoorsState(string slotType)

Перекрестные ссылки Math::Clamp() и GetCarDoorsState().