AddUnloadMethod
Introduction
Code Example
// At class scope
static Texture2D mCustomTexture;
// In CustomInitialize:
if(mCustomTexture == null)
{
mCustomTexture = FlatRedBallServices.Load("TextureName.png", ContentManagerName);
ContentManager contentManager = FlatRedBallServices.GetContentManagerByName(ContentManagerName);
contentManager.AddUnloadMethod("CustomUnloadForCharacter", CustomUnloadStaticContent);
}
// Finally define the CustomUnloadStaticContent method
static void CustomUnloadStaticContent()
{
mCustomTexture = null;
}Last updated
Was this helpful?