Exemplo n.º 1
0
 private void UpdateMusic(AudioManager.ListenerInfo listenerInfo, float listenerHeight)
 {
     if (!Singleton <LoadingManager> .instance.m_currentlyLoading)
     {
         if (this.m_musicVolume < 0, 01)
         {
             this.m_musicFile = null;
         }
         else
         {
             if (this.m_musicFiles != null && this.m_musicFiles.Length != 0)
             {
                 string[] array = this.m_musicFiles;
                 AudioManager.MusicType musicType = AudioManager.MusicType.Worst;
                 if (this.isAfterDarkMenu)
                 {
                     musicType = AudioManager.MusicType.Normal;
                 }
                 if (this.isShowingCredits)
                 {
                     musicType = AudioManager.MusicType.Bad;
                 }
                 if (Singleton <LoadingManager> .instance.m_loadingComplete)
                 {
                     if (Singleton <SimulationManager> .instance.m_isNightTime && this.m_musicFilesNight != null && this.m_musicFilesNight.Length != 0)
                     {
                         array = this.m_musicFilesNight;
                     }
                     int finalHappiness = (int)Singleton <DistrictManager> .instance.m_districts.m_buffer[0].m_finalHappiness;
                     if (finalHappiness < 25)
                     {
                         musicType = AudioManager.MusicType.Worst;
                     }
                     else
                     {
                         if (finalHappiness < 40)
                         {
                             musicType = AudioManager.MusicType.Bad;
                         }
                         else
                         {
                             if (finalHappiness < 55)
                             {
                                 musicType = AudioManager.MusicType.Normal;
                             }
                             else
                             {
                                 if (finalHappiness < 70)
                                 {
                                     musicType = AudioManager.MusicType.Good;
                                 }
                                 else
                                 {
                                     if (finalHappiness < 85)
                                     {
                                         musicType = AudioManager.MusicType.VeryWell;
                                     }
                                     else
                                     {
                                         if (finalHappiness < 95)
                                         {
                                             musicType = AudioManager.MusicType.NearWonder;
                                         }
                                         else
                                         {
                                             musicType = AudioManager.MusicType.AlmostWonder;
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     if (listenerHeight > 1400)
                     {
                         musicType += 7;
                     }
                 }
                 int num = Mathf.Min((int)musicType, array.Length - 1);
                 this.m_musicFile = array[num];
             }
         }
     }
Exemplo n.º 2
0
 private void UpdateMusic(AudioManager.ListenerInfo listenerInfo, float listenerHeight)
 {
     if (!Singleton <LoadingManager> .instance.m_currentlyLoading)
     {
         if (this.m_musicVolume < 0.01f)
         {
             this.m_musicFile = null;
         }
         else
         {
             if (this.m_musicFiles != null && this.m_musicFiles.Length != 0)
             {
                 AudioManager.MusicType musicType = (!this.isShowingCredits) ? AudioManager.MusicType.Worst : AudioManager.MusicType.Bad;
                 if (Singleton <LoadingManager> .instance.m_loadingComplete)
                 {
                     int finalHappiness = (int)Singleton <DistrictManager> .instance.m_districts.m_buffer[0].m_finalHappiness;
                     if (finalHappiness < 25)
                     {
                         musicType = AudioManager.MusicType.Worst;
                     }
                     else
                     {
                         if (finalHappiness < 40)
                         {
                             musicType = AudioManager.MusicType.Bad;
                         }
                         else
                         {
                             if (finalHappiness < 55)
                             {
                                 musicType = AudioManager.MusicType.Normal;
                             }
                             else
                             {
                                 if (finalHappiness < 70)
                                 {
                                     musicType = AudioManager.MusicType.Good;
                                 }
                                 else
                                 {
                                     if (finalHappiness < 85)
                                     {
                                         musicType = AudioManager.MusicType.VeryWell;
                                     }
                                     else
                                     {
                                         if (finalHappiness < 95)
                                         {
                                             musicType = AudioManager.MusicType.NearWonder;
                                         }
                                         else
                                         {
                                             musicType = AudioManager.MusicType.AlmostWonder;
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     if (listenerHeight > 1400f)
                     {
                         musicType += 7;
                     }
                 }
                 int num = Mathf.Min((int)musicType, this.m_musicFiles.Length - 1);
                 this.m_musicFile = this.m_musicFiles[num];
             }
         }
     }
 }