public void RemoveReplacer(AssetsFileInstance forFile, AssetsReplacer replacer, bool closePreviewStream = true) { AssetID assetId = new AssetID(forFile.name, replacer.GetPathID()); if (NewAssets.ContainsKey(assetId)) { NewAssets.Remove(assetId); } if (NewAssetDatas.ContainsKey(assetId)) { if (closePreviewStream) { NewAssetDatas[assetId].Close(); } NewAssetDatas.Remove(assetId); } if (ItemUpdated != null) { ItemUpdated(assetId); } if (NewAssets.Count == 0) { Modified = false; } }
public void RemoveReplacer(AssetsReplacer replacer, bool closePreviewStream = true) { if (replacer == null) { return; } var forInstance = LoadedFiles[replacer.GetFileID()]; var assetId = new AssetID(forInstance.path, replacer.GetPathID()); NewAssets.Remove(assetId); if (NewAssetDatas.ContainsKey(assetId)) { if (closePreviewStream) { NewAssetDatas[assetId].Close(); } NewAssetDatas.Remove(assetId); } Modified = NewAssets.Count != 0; }