private void InitMagazineSound(InitialMagazineSoundEffectNode weapon, bool selfTank) { Transform root = weapon.weaponSoundRoot.gameObject.transform; this.PrepareMagazineSoundEffect(weapon.magazineLastCartridgeChargeEffect, root); this.PrepareMagazineSoundEffect(weapon.magazineBlowOffEffect, root); this.PrepareMagazineSoundEffect(weapon.magazineOffsetEffect, root); this.PrepareMagazineSoundEffect(weapon.magazineRollEffect, root); this.PrepareMagazineSoundEffect(weapon.magazineCartridgeClickEffect, root); this.PrepareMagazineSoundEffect(weapon.magazineShotEffect, root); this.PrepareMagazineSoundEffect(weapon.magazineBounceEffect, root); this.PrepareMagazineSoundEffect(weapon.magazineCooldownEffect, root); MagazineShotEffectAudioGroupBehaviour component = weapon.magazineShotEffect.AudioSource.GetComponent <MagazineShotEffectAudioGroupBehaviour>(); weapon.magazineShotEffect.AudioSource.outputAudioMixerGroup = !selfTank ? component.RemoteShotGroup : component.SelfShotGroup; weapon.Entity.AddComponent <MagazineSoundEffectReadyComponent>(); }
public void InitMagazineSounds(NodeAddedEvent evt, InitialMagazineSoundEffectNode weapon, [Context, JoinByTank] SelfTankNode tank, SingleNode <SoundListenerBattleStateComponent> soundListener) { this.InitMagazineSound(weapon, true); }
public void InitMagazineSounds(NodeAddedEvent evt, [Combine] InitialMagazineSoundEffectNode weapon, [Combine, Context, JoinByTank] RemoteTankNode tank, SingleNode <SoundListenerBattleStateComponent> soundListener) { this.InitMagazineSound(weapon, false); }