public async Task <Sprite> GetCoverImageAsync(CancellationToken cancellationToken) { Beatmap bm = await GetBeatmap; var img = await bm.FetchCoverImage(cancellationToken); return(Utilities.Utilities.GetSprite(img)); }
public async Task <Sprite> GetCoverImageAsync(CancellationToken cancellationToken) { Beatmap bm = await GetBeatmap; if (bm != null) { var img = await bm.FetchCoverImage(cancellationToken); return(Utilities.Utilities.GetSprite(img)); } else { return(Sprite.Create(Texture2D.blackTexture, new Rect(0, 0, 2, 2), new Vector2(0, 0), 100.0f)); } }
public PreviewBeatmapStub(Beatmap bm) { this.levelID = bm.ID; this.levelHash = bm.Hash; this.beatmap = bm; this.isDownloaded = false; this.songName = bm.Metadata.SongName; this.songSubName = bm.Metadata.SongSubName; this.songAuthorName = bm.Metadata.SongAuthorName; this.levelAuthorName = bm.Metadata.LevelAuthorName; this.beatsPerMinute = bm.Metadata.BPM; this.songDuration = bm.Metadata.Duration; this._downloadable = DownloadableState.True; _rawCoverTask = bm.FetchCoverImage(CancellationToken.None); }