예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }