/** Deletes an sprite frame from the sprite frame cache. */ public void removeSpriteFrameByName(string name) { // explicit nil handling if (name == null) { return; } CCSpriteFrame frame = spriteFrameByName(name); // Is this an alias ? string key; if (_spriteFramesAliases.TryGetValue(name, out key)) { _spriteFrames.Remove(key); _spriteFramesAliases.Remove(name); } else { _spriteFrames.Remove(name); } _loadedFilenames.Remove(frame.textureFilename); }
public void removeMaterial(Texture2D texture) { Material existMat = _materials [texture]; if (existMat != null) { MonoBehaviour.Destroy(existMat); _materials.Remove(texture); } }