public void Start() { Instance = this; music = MusicLogic.fetch; preloadTimer.Elapsed += new System.Timers.ElapsedEventHandler(preloadTimer_Elapsed); //Utils.Log("# OS Version: " + Environment.OSVersion + ", Platform: " + Environment.OSVersion.Platform); //DeleteAllStock(); DontDestroyOnLoad(gameObject); /*Load(); UnloadUnusedTracks(); // Remove positional effects. music.audio1.panLevel = 0; music.audio1.dopplerLevel = 0; music.audio2.panLevel = 0; music.audio2.dopplerLevel = 0;*/ UnloadStockMusicPlayer(); /*for (int i = 0; i < Enum.GetNames(typeof(Enums.Channel)).Length; i++) { Speakers[i] = new Speaker(gameObject, (Enums.Channel)i); }*/ // Set up the main audio source. Speaker = gameObject.AddComponent<AudioSource>(); // Disable positional effects. Speaker.spatialBlend = 0; Speaker.dopplerLevel = 0; Speaker.loop = false; Speaker.volume = GameSettings.MUSIC_VOLUME; fader = new Fader(Speaker); // TODO: Change volume on unpause or main menu. EventManager.Instance.AddEvents(); // Set up test playlists. //SoundTest soundTest = new SoundTest(); //SoundTest.CreatePlaylists(Playlists); Playlists = Persistor.LoadPlaylists(); }