private void Start() { playerCanvas = Instantiate(playerCanvasPrefab); if (playerCanvasLobbyOffset) { playerCanvas.lobbyOffset = true; } aSource = GetComponent <AudioSource>(); slidePosition = slidePositionMax; ShuffleSongs(); if (ActiveData.ESportsFullyReady) { Sanicball.Logic.MatchManager m = FindObjectOfType <Sanicball.Logic.MatchManager>(); if (!m.InLobby) { List <Song> p = playlist.ToList(); Song s = new Song(); s.name = "Skrollex - Bungee Ride"; s.clip = ActiveData.ESportsMusic; p.Insert(0, s); playlist = p.ToArray(); } } aSource.clip = playlist[0].clip; currentSongID = 0; isPlaying = aSource.isPlaying; if (startPlaying && ActiveData.GameSettings.music) { Play(); } if (fadeIn) { aSource.volume = 0f; } if (!ActiveData.GameSettings.music) { fastSource.Stop(); } }
private void Start() { playerCanvas = Instantiate(playerCanvasPrefab); if (playerCanvasLobbyOffset) { playerCanvas.lobbyOffset = true; } aSource = GetComponent <AudioSource>(); slidePosition = slidePositionMax; ShuffleSongs(); Sanicball.Logic.MatchManager mm = FindObjectOfType <Sanicball.Logic.MatchManager>(); if (mm) { var players = mm.Players; foreach (var p in players) { if (p.CtrlType != SanicballCore.ControlType.None) { if (!mm.InLobby) { if (p.CharacterId == 16) { List <Song> play = playlist.ToList(); Song s = new Song(); s.name = "Thomas the Tank Engine"; s.clip = ActiveData.ThomasMusic; play.Insert(0, s); playlist = play.ToArray(); } if (p.CharacterId == 17) { List <Song> play = playlist.ToList(); Song s = new Song(); s.name = "Super Saiyan 2.0"; s.clip = ActiveData.GokuMusic; play.Insert(0, s); playlist = play.ToArray(); } } } } } if (ActiveData.ESportsFullyReady) { Sanicball.Logic.MatchManager m = FindObjectOfType <Sanicball.Logic.MatchManager>(); if (!m.InLobby) { List <Song> p = playlist.ToList(); Song s = new Song(); s.name = "Skrollex - Bungee Ride"; s.clip = ActiveData.ESportsMusic; p.Insert(0, s); playlist = p.ToArray(); } } else if (ActiveData.greenModeFullyReady) { Sanicball.Logic.MatchManager m = FindObjectOfType <Sanicball.Logic.MatchManager>(); if (!m.InLobby) { List <Song> p = playlist.ToList(); Song s = new Song(); s.name = "It's not easy being green - Kermit the Froggo"; s.clip = ActiveData.GreenMusic; p.Insert(0, s); playlist = p.ToArray(); } } else if (ActiveData.blueModeFullyReady) { Sanicball.Logic.MatchManager m = FindObjectOfType <Sanicball.Logic.MatchManager>(); if (!m.InLobby) { List <Song> p = playlist.ToList(); Song s = new Song(); s.name = "I'm Blue - Eiffel 65"; s.clip = ActiveData.BlueMusic; p.Insert(0, s); playlist = p.ToArray(); } } else if (ActiveData.redModeFullyReady) { Sanicball.Logic.MatchManager m = FindObjectOfType <Sanicball.Logic.MatchManager>(); if (!m.InLobby) { List <Song> p = playlist.ToList(); Song s = new Song(); s.name = "Our national anthem - Toad"; s.clip = ActiveData.RedMusic; p.Insert(0, s); playlist = p.ToArray(); } } aSource.clip = playlist[0].clip; currentSongID = 0; isPlaying = aSource.isPlaying; if (startPlaying && ActiveData.GameSettings.music) { Play(); } if (fadeIn) { aSource.volume = 0f; } if (!ActiveData.GameSettings.music) { fastSource.Stop(); } }