@@ -22,6 +22,16 @@ public sealed class BundleEntry {
22
22
/// </summary>
23
23
public string RelativePath { get ; }
24
24
25
+ /// <summary>
26
+ /// The offset of the entry's data.
27
+ /// </summary>
28
+ public long Offset { get ; }
29
+
30
+ /// <summary>
31
+ /// The size of the entry's data.
32
+ /// </summary>
33
+ public long Size { get ; }
34
+
25
35
/// <summary>
26
36
/// The file name of the entry.
27
37
/// </summary>
@@ -44,15 +54,19 @@ public byte[] Data {
44
54
}
45
55
}
46
56
47
- BundleEntry ( BundleFileType type , string relativePath , byte [ ] data ) {
57
+ BundleEntry ( BundleFileType type , string relativePath , long offset , long size , byte [ ] data ) {
48
58
Type = type ;
49
59
RelativePath = relativePath . Replace ( '/' , '\\ ' ) ;
60
+ Offset = offset ;
61
+ Size = size ;
50
62
this . data = data ;
51
63
}
52
64
53
- BundleEntry ( BundleFileType type , string relativePath , DataReader reader ) {
65
+ BundleEntry ( BundleFileType type , string relativePath , long offset , long size , DataReader reader ) {
54
66
Type = type ;
55
67
RelativePath = relativePath . Replace ( '/' , '\\ ' ) ;
68
+ Offset = offset ;
69
+ Size = size ;
56
70
this . reader = reader ;
57
71
}
58
72
@@ -67,9 +81,9 @@ internal static IReadOnlyList<BundleEntry> ReadEntries(DataReader reader, int co
67
81
string path = reader . ReadSerializedString ( ) ;
68
82
69
83
if ( compSize == 0 )
70
- res [ i ] = new BundleEntry ( type , path , reader . Slice ( ( uint ) offset , ( uint ) size ) ) ;
84
+ res [ i ] = new BundleEntry ( type , path , offset , size , reader . Slice ( ( uint ) offset , ( uint ) size ) ) ;
71
85
else
72
- res [ i ] = new BundleEntry ( type , path , ReadCompressedEntryData ( reader , offset , size , compSize ) ) ;
86
+ res [ i ] = new BundleEntry ( type , path , offset , size , ReadCompressedEntryData ( reader , offset , size , compSize ) ) ;
73
87
}
74
88
75
89
return res ;
0 commit comments