Beispiel #1
0
        public void Read(SerializedReader reader)
        {
            if (HasScriptType(reader.Generation))
            {
                ClassID        = (ClassIDType)reader.ReadInt32();
                IsStrippedType = reader.ReadBoolean();
                ScriptID       = reader.ReadInt16();
            }
            else
            {
                UniqueTypeID = reader.ReadInt32();
            }

            if (HasHash(reader.Generation))
            {
                if (ClassID == ClassIDType.MonoBehaviour)
                {
                    ScriptHash.Read(reader);
                }
                TypeHash.Read(reader);
            }

            // isSerializeTypeTrees
            Tree?.Read(reader);
        }
Beispiel #2
0
        public void Read(SerializedReader reader)
        {
            if (TypeTreeNode.IsFormat5(reader.Generation))
            {
                int nodesCount       = reader.ReadInt32();
                int customBufferSize = reader.ReadInt32();
                Nodes = new TypeTreeNode[nodesCount];
                for (int i = 0; i < nodesCount; i++)
                {
                    TypeTreeNode node = new TypeTreeNode();
                    node.Read(reader);
                    Nodes[i] = node;
                }
                CustomTypeBuffer = new byte[customBufferSize];
                reader.Read(CustomTypeBuffer, 0, CustomTypeBuffer.Length);

                if (HasUnknown(reader.Generation))
                {
                    Unknown = reader.ReadInt32();
                }
            }
            else
            {
                List <TypeTreeNode> nodes = new List <TypeTreeNode>();
                ReadTreeNode(reader, nodes, 0);
                Nodes = nodes.ToArray();
            }
        }
Beispiel #3
0
 public void Read(SerializedReader reader)
 {
     if (IsFormat5(reader.Generation))
     {
         Version     = reader.ReadUInt16();
         Depth       = reader.ReadByte();
         IsArrayBool = reader.ReadBoolean();
         TypeOffset  = reader.ReadUInt32();
         NameOffset  = reader.ReadUInt32();
         ByteSize    = reader.ReadInt32();
         Index       = reader.ReadInt32();
         MetaFlag    = (TransferMetaFlags)reader.ReadUInt32();
         if (HasUnknown(reader.Generation))
         {
             Unknown1 = reader.ReadUInt32();
             Unknown2 = reader.ReadUInt32();
         }
     }
     else
     {
         Type     = reader.ReadStringZeroTerm();
         Name     = reader.ReadStringZeroTerm();
         ByteSize = reader.ReadInt32();
         Index    = reader.ReadInt32();
         IsArray  = reader.ReadInt32();
         Version  = reader.ReadInt32();
         MetaFlag = (TransferMetaFlags)reader.ReadUInt32();
     }
 }
Beispiel #4
0
 public void Read(SerializedReader reader)
 {
     if (IsFormat5(reader.Generation))
     {
         Version       = reader.ReadUInt16();
         Level         = reader.ReadByte();
         TypeFlags     = reader.ReadByte();
         TypeStrOffset = reader.ReadUInt32();
         NameStrOffset = reader.ReadUInt32();
         ByteSize      = reader.ReadInt32();
         Index         = reader.ReadInt32();
         MetaFlag      = (TransferMetaFlags)reader.ReadUInt32();
         if (HasRefTypeHash(reader.Generation))
         {
             RefTypeHash = reader.ReadUInt64();
         }
     }
     else
     {
         Type      = reader.ReadStringZeroTerm();
         Name      = reader.ReadStringZeroTerm();
         ByteSize  = reader.ReadInt32();
         Index     = reader.ReadInt32();
         TypeFlags = reader.ReadInt32();
         Version   = reader.ReadInt32();
         MetaFlag  = (TransferMetaFlags)reader.ReadUInt32();
     }
 }
Beispiel #5
0
 public void Read(SerializedReader reader)
 {
     if (HasAssetName(reader.Generation))
     {
         AssetPath = reader.ReadStringZeroTerm();
     }
     if (HasHash(reader.Generation))
     {
         Hash.Read(reader);
         Type = (AssetType)reader.ReadInt32();
     }
     FilePathOrigin = reader.ReadStringZeroTerm();
     FilePath       = FilenameUtils.FixFileIdentifier(FilePathOrigin);
 }
Beispiel #6
0
        public void Read(SerializedReader reader)
        {
            if (HasScriptTypeIndex(reader.Generation))
            {
                TypeID = (ClassIDType)reader.ReadInt32();
            }
            else
            {
                OriginalTypeID = reader.ReadInt32();
            }
            if (HasIsStrippedType(reader.Generation))
            {
                IsStrippedType = reader.ReadBoolean();
            }
            if (HasScriptTypeIndex(reader.Generation))
            {
                ScriptTypeIndex = reader.ReadInt16();
            }

            if (HasHash(reader.Generation))
            {
                if (TypeID == ClassIDType.MonoBehaviour)
                {
                    ScriptID.Read(reader);
                }
                OldTypeHash.Read(reader);
            }

            if (OldType != null)
            {
                OldType.Read(reader);
                if (HasTypeDependencies(reader.Generation))
                {
                    TypeDependencies = reader.ReadInt32Array();
                }
            }
        }
Beispiel #7
0
        private static void ReadTreeNode(SerializedReader reader, ICollection <TypeTreeNode> nodes, byte depth)
        {
            TypeTreeNode node = new TypeTreeNode();

            node.Read(reader);
            node.Depth = depth;
            nodes.Add(node);

            int childCount = reader.ReadInt32();

            for (int i = 0; i < childCount; i++)
            {
                ReadTreeNode(reader, nodes, (byte)(depth + 1));
            }
        }
 private void Read(SerializedReader reader)
 {
     Hierarchy.Read(reader);
     Entries = reader.ReadSerializedArray <AssetEntry>();
     if (HasPreload(reader.Generation))
     {
         Preloads = reader.ReadSerializedArray <ObjectPtr>();
     }
     Dependencies = reader.ReadSerializedArray <FileIdentifier>();
     if (HasUnknown(reader.Generation))
     {
         Unknown = reader.ReadStringZeroTerm();
     }
     if (HasUnknown2(reader.Generation))
     {
         Unknown2 = reader.ReadInt32();
     }
 }