private string GetLoadingTimeUrl(AssetId assetId) { string url; AssetLoadingTimeUrls.TryGetValue(assetId, out url); return(url); }
public async Task UnloadAsset(AssetId id) { GameDispatcher.EnsureAccess(); // Unload this object if it has already been loaded. using (await database.LockAsync()) { string url; if (AssetLoadingTimeUrls.TryGetValue(id, out url)) { UnloadContent(url); // Remove assets that were previously loaded but are not anymore from the assetLoadingTimeUrls map. foreach (var loadedUrls in AssetLoadingTimeUrls.Where(x => !Game.Content.IsLoaded(x.Value)).ToList()) { AssetLoadingTimeUrls.Remove(loadedUrls.Key); } } } }
private bool IsCurrentlyLoaded(AssetId assetId, bool loadedManuallyOnly = false) { string url; return(AssetLoadingTimeUrls.TryGetValue(assetId, out url) && Game.Content.IsLoaded(url, loadedManuallyOnly)); }