private void UnloadContent(string url) { #if DEBUG if (enableReferenceLogging) { debugStats = debugStats ?? Game.Content.GetStats(); var entry = debugStats.LoadedAssets.FirstOrDefault(x => x.Url == url); logger?.Debug($"Unloading {url} (Pub: {entry?.PublicReferenceCount ?? 0}, Priv:{entry?.PrivateReferenceCount ?? 0})"); } #endif Game.Content.Unload(url); #if DEBUG if (enableReferenceLogging) { debugStats = Game.Content.GetStats(); var entry = debugStats.LoadedAssets.FirstOrDefault(x => x.Url == url); logger?.Debug($"Unloaded {url} (Pub: {entry?.PublicReferenceCount ?? 0}, Priv:{entry?.PrivateReferenceCount ?? 0})"); } #endif }
private object LoadContent(Type type, string url) { #if DEBUG if (enableReferenceLogging) { debugStats = debugStats ?? Game.Content.GetStats(); var entry = debugStats.LoadedAssets.FirstOrDefault(x => x.Url == url); logger?.Debug($"Loading {url} (Pub: {entry?.PublicReferenceCount ?? 0}, Priv:{entry?.PrivateReferenceCount ?? 0})"); } #endif var result = Game.Content.Load(type, url); #if DEBUG if (enableReferenceLogging) { debugStats = Game.Content.GetStats(); var entry = debugStats.LoadedAssets.FirstOrDefault(x => x.Url == url); logger?.Debug($"Loaded {url} (Pub: {entry?.PublicReferenceCount ?? 0}, Priv:{entry?.PrivateReferenceCount ?? 0})"); } #endif return(result); }
private void ReloadContent(object obj, AssetItem assetItem) { var url = assetItem.Location; #if DEBUG if (enableReferenceLogging) { debugStats = debugStats ?? Game.Content.GetStats(); var entry = debugStats.LoadedAssets.FirstOrDefault(x => x.Url == url); logger?.Debug($"Reloading {url} (Pub: {entry?.PublicReferenceCount ?? 0}, Priv:{entry?.PrivateReferenceCount ?? 0})"); } #endif Game.Content.Reload(obj, url); AssetLoadingTimeUrls[assetItem.Id] = url; #if DEBUG if (enableReferenceLogging) { debugStats = Game.Content.GetStats(); var entry = debugStats.LoadedAssets.FirstOrDefault(x => x.Url == url); logger?.Debug($"Reloaded {url} (Pub: {entry?.PublicReferenceCount ?? 0}, Priv:{entry?.PrivateReferenceCount ?? 0})"); } #endif }