protected virtual FileCollection GetAllUsedByFiles(File file, FileCollection allfiles) { FileCollection files = new FileCollection(); foreach (File tmpfile in allfiles) { if (Object.ReferenceEquals(tmpfile, file)) { continue; } if (files.Contains(tmpfile.FileID)) { continue; } foreach (Sprite sprite in tmpfile.Sprites.SortByOrder()) { if (sprite.RelatiedFile == file.FileID) { files.Add(tmpfile); break; } } } return(files.SortByOrder()); }
protected virtual FileCollection GetAllChildrenFiles(File file, FileCollection allfiles) { FileCollection files = new FileCollection(); foreach (Sprite sprite in file.Sprites.SortByOrder()) { if (sprite.RelatiedFile == file.FileID) { continue; } File relatiedFile = allfiles.TryGetItem(sprite.RelatiedFile); if (relatiedFile != null && !files.Contains(relatiedFile.FileID)) { files.Add(relatiedFile); } } return(files.SortByOrder()); }