예제 #1
0
    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);
    }
예제 #2
0
    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);
    }