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

◆ CreateSoundForAnimationSource()

EffectSound Car::CreateSoundForAnimationSource ( string animSource)
inlineprotected

См. определение в файле CarScript.c строка 1547

1548 {
1549 vector position = vector.Zero;
1550 int pivotIndex = -1;
1551
1552 string selectionName = GetSelectionFromAnimSource(animSource);
1553 if (selectionName != "")
1554 {
1555 position = GetSelectionBasePositionLS(selectionName);
1556
1557 int level = GetViewGeometryLevel();
1558
1559 array<int> pivots = new array<int>();
1560
1561 pivots.Clear();
1562 GetBonePivotsForAnimationSource(level, animSource, pivots);
1563
1564 if (pivots.Count())
1565 {
1566 pivotIndex = pivots[0];
1567 }
1568 }
1569
1570 WaveKind waveKind = WaveKind.WAVEEFFECTEX;
1571
1572 EffectSound sound = new EffectSound();
1573
1574 PlayerBase player;
1575 if (Class.CastTo(player, GetGame().GetPlayer()))
1576 {
1577 if (player.IsCameraInsideVehicle())
1578 {
1579 waveKind = WaveKind.WAVEEFFECT;
1580 }
1581 }
1582
1583 sound.SetAutodestroy(true);
1584 sound.SetParent(this, pivotIndex);
1585 sound.SetPosition(ModelToWorld(position));
1586 sound.SetLocalPosition(position);
1587 sound.SetSoundWaveKind(waveKind);
1588
1589 return sound;
1590 }
PlayerBase GetPlayer()
Определения ModifierBase.c:51
WaveKind
Определения Sound.c:2
string GetSelectionFromAnimSource(string animSource)
Определения CarScript.c:2508
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Определения EffectSound.c:603
void SetSoundWaveKind(WaveKind wave_kind)
Set WaveKind for the sound.
Определения EffectSound.c:784
override void SetParent(Object parent_obj, int pivot)
Set parent for the sound to follow.
Определения EffectSound.c:654
proto native CGame GetGame()

Перекрестные ссылки Class::CastTo(), GetGame(), GetPlayer(), GetSelectionFromAnimSource(), EffectSound::SetAutodestroy(), EffectSound::SetParent(), EffectSound::SetSoundWaveKind() и vector::Zero.

Используется в HandleDoorsSound() и HandleSeatAdjustmentSound().