public static ModelLoadResult LoadModels(PAKFile file) { var ret = new ModelLoadResult(); foreach (var gi in file.FileGroups.Select((g, i) => new {g, i})) { foreach (var entry in gi.g.Entries) { string name = gi.i + "_" + entry.OBJ.Name; try { Model m = LoadModel(file, entry.OBJ); ret.Models.Add(new Tuple<string, Model>(name, m)); } catch (Exception e) { ret.Messages.Add("! "+name+": "+e.Message); } } } return ret; }
public static ModelLoadResult LoadModels(PAKFile file) { var ret = new ModelLoadResult(); foreach (var gi in file.FileGroups.Select((g, i) => new { g, i })) { foreach (var entry in gi.g.Entries) { string name = gi.i + "_" + entry.OBJ.Name; try { Model m = LoadModel(file, entry.OBJ); ret.Models.Add(new Tuple <string, Model>(name, m)); } catch (Exception e) { ret.Messages.Add("! " + name + ": " + e.Message); } } } return(ret); }