ContentManager.ReadAsset Generic Method
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
- Type of the asset specified for loading.
- The name of the asset to be loaded from disk.
- Delegate function for handling the disposition of assets. If recordDisposableObject is null, the default lifespan tracking and management is used, so unloading or disposing of the content manager frees everything that has been loaded through it. If recordDisposableObject specifies a valid delegate, that delegate is used instead of the default lifespan tracking and is called every time the loader encounters a type that implements IDisposable. You must use your own code to unload assets loaded in this fashion, since ContentManager's Unload method will not be aware of them.
You can customize how shared assets are managed by overriding ContentManager's
Load method. In your own
Load method, keep
track of what has been loaded, and call ReadAsset when you need a new asset from disk.