Example #1
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;
            }
        }