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 (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();
     }
 }
        private void Read(SerializedReader reader)
        {
            if (HasSignature(reader.Generation))
            {
                string signature = reader.ReadStringZeroTerm();
                UnityVersion = Version.Parse(signature);
            }
            if (HasPlatform(reader.Generation))
            {
                TargetPlatform = (Platform)reader.ReadUInt32();
            }

            bool enableTypeTree;

            if (HasEnableTypeTree(reader.Generation))
            {
                EnableTypeTree = reader.ReadBoolean();
                enableTypeTree = EnableTypeTree;
            }
            else
            {
                enableTypeTree = true;
            }

#warning TODO: pass enableTypeTree as Read argument
            Types = reader.ReadSerializedArray(() => new SerializedType(enableTypeTree));
            if (HasLongFileID(reader.Generation))
            {
                LongFileID = reader.ReadUInt32();
            }

#warning TODO: pass LongFileID to ObjectInfo
            Object = reader.ReadSerializedArray <ObjectInfo>();
            if (HasScriptTypes(reader.Generation))
            {
                ScriptTypes = reader.ReadSerializedArray <LocalSerializedObjectIdentifier>();
            }
            Externals = reader.ReadSerializedArray <FileIdentifier>();
            if (HasRefTypes(reader.Generation))
            {
                RefTypes = reader.ReadSerializedArray(() => new SerializedType(enableTypeTree));
            }
            if (HasUserInformation(reader.Generation))
            {
                UserInformation = reader.ReadStringZeroTerm();
            }
        }
Beispiel #4
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();
                }
            }
        }