Esempio n. 1
0
        public void Read(UnityBinaryReader reader)
        {
            ClassID         = reader.ReadInt();
            IsStrippedType  = reader.ReadByte() != 0;
            ScriptTypeIndex = reader.ReadShort();

            if (ClassID == (int)ClassIDType.MonoBehaviour)
            {
                ScriptID = reader.ReadBytes(16);
            }
            OldTypeHash = reader.ReadBytes(16);
        }
            public void Read(UnityBinaryReader reader)
            {
                var typeEmpty = reader.ReadStringToNull();

                Guid     = new Guid(reader.ReadBytes(16));
                Type     = reader.ReadInt();
                PathName = reader.ReadStringToNull();
            }
Esempio n. 3
0
 public void Read(UnityBinaryReader reader)
 {
     MetadataSize = reader.ReadIntBE();
     FileSize     = reader.ReadIntBE();
     Version      = reader.ReadIntBE();
     DataOffset   = reader.ReadIntBE();
     IsBigEndian  = reader.ReadByte() == 0 ? false : true;
     Reserved     = reader.ReadBytes(3);
 }
Esempio n. 4
0
            private int readNextBlock(byte[] dest, int offset)
            {
                if (idx >= _infos.Length)
                {
                    throw new IndexOutOfRangeException();
                }
                switch (_infos[idx].flag)
                {
                default:
                    _reader.ReadBytes(dest, offset, _infos[idx].uncompressedSize);
                    break;

                case 1:     // LZMA
                    throw new NotSupportedException("LZMA is not supported");

                case 2:     // LZ4
                case 3:     // LZ4HC
                    _reader.ReadLZ4Data(_infos[idx].compressedSize, _infos[idx].uncompressedSize, dest, offset);
                    break;
                }
                return(_infos[idx++].uncompressedSize);
            }
Esempio n. 5
0
        private void readObjects(UnityBinaryReader reader)
        {
            int object_count = reader.ReadInt();

            Objects = new ObjectType[object_count];
            for (int i = 0; i < object_count; i++)
            {
                Objects[i]        = new ObjectType();
                Objects[i].parent = new WeakReference <AssetsFile>(this);

                reader.Align(4);
                Objects[i].PathID = reader.ReadLong();
                var byteStart = reader.ReadUInt();
                var byteSize  = reader.ReadUInt();
                Objects[i].TypeID = reader.ReadInt();

                // Read Body
                var final_pos = reader.Position;
                reader.Position = Header.DataOffset + (int)byteStart;
                Objects[i].Data = reader.ReadBytes((int)byteSize);
                reader.Position = final_pos;
            }
        }