public bool TryGetAssetsFile(string assetsFilename, out AssetsFile loadedFile) { lock (_openAssetsFiles) { if (_openAssetsFiles.ContainsKey(assetsFilename)) { loadedFile = _openAssetsFiles[assetsFilename]; return(true); } AssetsFile assetsFile = null; try { assetsFile = new AssetsFile(this, _fileProvider, _assetsRootPath, assetsFilename, false); } catch { loadedFile = null; return(false); } _openAssetsFiles.Add(assetsFilename, assetsFile); assetsFile.LoadData(); loadedFile = assetsFile; return(true); } }
public AssetsFile GetAssetsFile(string assetsFilename) { lock (_openAssetsFiles) { if (_openAssetsFiles.ContainsKey(assetsFilename.ToLower())) { return(_openAssetsFiles[assetsFilename.ToLower()]); } AssetsFile assetsFile = new AssetsFile(this, _fileProvider, _assetsRootPath, assetsFilename, false); _openAssetsFiles.Add(assetsFilename.ToLower(), assetsFile); assetsFile.LoadData(); return(assetsFile); } }