public static AssetsFile LoadAssetFromBundle(AssetBundleFile bundle, int index) { bundle.GetFileRange(index, out long offset, out long length); Stream stream = new SegmentStream(bundle.reader.BaseStream, offset, length); AssetsFileReader reader = new AssetsFileReader(stream); return(new AssetsFile(reader)); }
public static byte[] LoadAssetDataFromBundle(AssetBundleFile bundle, int index) { bundle.GetFileRange(index, out long offset, out long length); AssetsFileReader reader = bundle.reader; reader.Position = offset; return(reader.ReadBytes((int)length)); }