Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
            }
        }