Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }