public void Explosion(BulletHitEvent e, Node node, [JoinByTank] HitExplosionSoundNode weapon, [JoinAll] SingleNode <SoundListenerBattleStateComponent> soundListener) { HitExplosionSoundComponent hitExplosionSound = weapon.hitExplosionSound; GameObject soundPrefab = hitExplosionSound.SoundPrefab; base.CreateHitExplosionSoundEffect(e.Position, soundPrefab, hitExplosionSound.Duration); }
public void CreateHitSoundEffect(HitEvent evt, HitExplosionSoundNode weapon, [JoinAll] SingleNode <SoundListenerBattleStateComponent> soundListener) { HitExplosionSoundComponent hitExplosionSound = weapon.hitExplosionSound; GameObject soundPrefab = hitExplosionSound.SoundPrefab; float duration = hitExplosionSound.Duration; if (evt.Targets != null) { foreach (HitTarget target in evt.Targets) { base.CreateHitExplosionSoundEffect(target.TargetPosition, soundPrefab, duration); } } if (evt.StaticHit != null) { base.CreateHitExplosionSoundEffect(evt.StaticHit.Position, soundPrefab, duration); } }