Пример #1
0
 public ModelFile GetModel(string filename)
 {
     if (!models.ContainsKey(filename))
     {
         var file = new ModelFile(filename, this);
         if (file.TextureLibrary != null)
         {
             AddTextures(file.TextureLibrary, filename);
         }
         if (file.MaterialLibrary != null)
         {
             AddMaterials(file.MaterialLibrary, filename);
         }
         if (file.VMeshLibrary != null)
         {
             AddMeshes(file.VMeshLibrary);
         }
         file.Initialize(this);
         models.Add(filename, file);
     }
     return(models [filename]);
 }