예제 #1
0
 void MakeLoopEndSwitch(GunSoundSourceElement element, double switchTime)
 {
     element.MakeLoopEndSwitch(switchTime);
     if (element.isReverb)
     {
         element.volume = lastElementVolume * reverbVolume;
     }
     else
     {
         element.volume = lastElementVolume;
     }
     element.priority              = _priority;
     element.maxDistance           = _maxDistance;
     element.outputAudioMixerGroup = _outputAudioMixerGroup;
 }
예제 #2
0
 void SetSetting(GunSoundSetting setting)
 {
     lastSetting = setting;
     for (int i = 0; i < elements.Length; ++i)
     {
         elements[i].Destroy();
     }
     if (setting)
     {
         if (setting)
         {
             setting.InitCheck();
         }
         var sounds = setting.sounds;
         elements             = new GunSoundSourceElement[sounds.Length];
         _maxEndSoundDuration = 0;
         for (int i = 0; i < sounds.Length; ++i)
         {
             elements[i]          = new GunSoundSourceElement(setting, sounds[i], this);
             _maxEndSoundDuration = Mathf.Max(_maxEndSoundDuration, elements[i].maxEndSoundDuration);
         }
     }
 }