File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ public partial class AssetsManager
1414 /// <param name="path">The path to set on the <see cref="AssetsFileInstance"/>.</param>
1515 /// <param name="unpackIfPacked">Unpack the bundle if it's compressed?</param>
1616 /// <returns>The loaded <see cref="BundleFileInstance"/>.</returns>
17- public BundleFileInstance LoadBundleFile ( Stream stream , string path , bool unpackIfPacked = true )
17+ public BundleFileInstance LoadBundleFile ( Stream stream , string path , bool unpackIfPacked = true , bool leaveOpen = false )
1818 {
1919 BundleFileInstance bunInst ;
2020 string lookupKey = GetFileLookupKey ( path ) ;
2121 if ( BundleLookup . TryGetValue ( lookupKey , out bunInst ) )
2222 return bunInst ;
2323
24- bunInst = new BundleFileInstance ( stream , path , unpackIfPacked ) ;
24+ bunInst = new BundleFileInstance ( stream , path , unpackIfPacked , leaveOpen ) ;
2525 lock ( BundleLookup )
2626 {
2727 lock ( Bundles )
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ public class BundleFileInstance
2020 public Stream BundleStream => file . Reader . BaseStream ;
2121 public Stream DataStream => file . DataReader . BaseStream ;
2222
23- public BundleFileInstance ( Stream stream , string filePath , bool unpackIfPacked = true )
23+ public BundleFileInstance ( Stream stream , string filePath , bool unpackIfPacked = true , bool leaveOpen = false )
2424 {
2525 path = Path . GetFullPath ( filePath ) ;
2626 name = Path . GetFileName ( path ) ;
2727 file = new AssetBundleFile ( ) ;
28- file . Read ( new AssetsFileReader ( stream ) ) ;
28+ file . Read ( new AssetsFileReader ( stream , leaveOpen ) ) ;
2929 if ( file . Header != null && file . DataIsCompressed && unpackIfPacked )
3030 {
3131 file = BundleHelper . UnpackBundle ( file ) ;
You can’t perform that action at this time.
0 commit comments