/// <summary> /// Removes a texture from our manager list /// </summary> /// <param name="name">The texture name</param> public static void RemoveTexture(string name) { InfTexture texture = null; if (!String.IsNullOrEmpty(name)) { if (_textures.TryGetValue(name, out texture)) { texture.UnloadContent(); _textures.Remove(name); _texturesLoaded--; } } }
/// <summary> /// Removes a texture from our manager list /// </summary> /// <param name="texture">Our Texture Object</param> public static void RemoveTexture(InfTexture texture) { if (_textures.ContainsValue(texture)) { foreach (InfTexture text in _textures.Values) { if (text == texture) { string filename = text.FileName; texture.UnloadContent(); _textures.Remove(filename); _texturesLoaded--; } } } }