Esempio n. 1
0
 bool IUse.UseEntity(UseEntityEventArgs eventArgs)
 {
     if (!string.IsNullOrWhiteSpace(_soundName))
     {
         if (_pitchVariation > 0.0)
         {
             SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
             return(true);
         }
         if (_semitoneVariation > 0)
         {
             SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioHelpers.WithSemitoneVariation(_semitoneVariation).WithVolume(-2f));
             return(true);
         }
         SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioParams.Default.WithVolume(-2f));
         return(true);
     }
     return(false);
 }
 bool IUse.UseEntity(UseEntityEventArgs eventArgs)
 {
     if (!string.IsNullOrWhiteSpace(_soundName))
     {
         if (_pitchVariation > 0.0)
         {
             EntitySystem.Get <AudioSystem>().PlayFromEntity(_soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
             return(true);
         }
         if (_semitoneVariation > 0)
         {
             EntitySystem.Get <AudioSystem>().PlayFromEntity(_soundName, Owner, AudioHelpers.WithSemitoneVariation(_semitoneVariation).WithVolume(-2f));
             return(true);
         }
         EntitySystem.Get <AudioSystem>().PlayFromEntity(_soundName, Owner, AudioParams.Default.WithVolume(-2f));
         return(true);
     }
     return(false);
 }