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

◆ OnSound()

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

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

301 {
302 switch (ctrl)
303 {
304 case CarSoundCtrl.DOORS:
305 float newValue = 0;
306 if (GetCarDoorsState("Hatchback_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
307 {
308 newValue += 0.25;
309 }
310
311 if (GetCarDoorsState("Hatchback_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
312 {
313 newValue += 0.25;
314 }
315
316 if (GetCarDoorsState("Hatchback_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
317 {
318 newValue += 0.25;
319 }
320
321 if (GetCarDoorsState("Hatchback_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
322 {
323 newValue += 0.25;
324 }
325
326 return Math.Clamp(newValue, 0, 1);
327 break;
328 }
329
330 return super.OnSound(ctrl, oldValue);
331 }
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().