Exemplo n.º 1
0
        private string GetLoadingTimeUrl(AssetId assetId)
        {
            string url;

            AssetLoadingTimeUrls.TryGetValue(assetId, out url);
            return(url);
        }
Exemplo n.º 2
0
        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);
                    }
                }
            }
        }
Exemplo n.º 3
0
        private bool IsCurrentlyLoaded(AssetId assetId, bool loadedManuallyOnly = false)
        {
            string url;

            return(AssetLoadingTimeUrls.TryGetValue(assetId, out url) && Game.Content.IsLoaded(url, loadedManuallyOnly));
        }