public void LoadTracks(MusicTrack[] tracks, int currentLevel, float progress) { this.currentLevel = currentLevel; this.tracks = tracks; this.mapper = gameObject.AddComponent <BeatMapper>(); mapper.ChangeBeatMap(tracks[currentLevel - 1].BeatMap); InitialiseTracks(progress); }
public void CrossFadeToTrackLevel(int level) { if (level > tracks.Length) { Debug.Log(string.Format("No track level for %s", level)); return; } var newTrackIndex = level - 1; StartCoroutine(CrossFadeTracks(currentTrackIndex, newTrackIndex)); currentTrackIndex = newTrackIndex; mapper.ChangeBeatMap(tracks[currentTrackIndex].BeatMap); }