コード例 #1
0
 void Start()
 {
     config = AudioMufflerConfig.loadConfig();
     if (!config.EngageMuffler)
     {
         return;
     }
     GameEvents.onVesselChange.Add(VesselChange);
     GameEvents.onVesselWasModified.Add(VesselWasModified);
     AudioSource[] audioSources = FindObjectsOfType(typeof(AudioSource)) as AudioSource[];
     audioMixer = AudioMixerFacade
                  .InitializeMixer(KSP.IO.IOUtils.GetFilePathFor(typeof(Muffler), "mixer.bundle")
                                   .Replace("/", System.IO.Path.DirectorySeparatorChar.ToString()));
     StockAudio.PrepareAudioSources(audioMixer, audioSources);
     audioMixer.setInVesselCutoff(config.WallCutoff);
 }