public void Read(SerializedFileReader reader) { if (IsReadSignature(reader.Generation)) { string signature = reader.ReadStringZeroTerm(); Version.Parse(signature); } if (IsReadAttributes(reader.Generation)) { Platform = (Platform)reader.ReadUInt32(); if (!Enum.IsDefined(typeof(Platform), Platform)) { throw new Exception($"Unsuported platform {Platform} for asset file '{Name}'"); } } if (IsReadSerializeTypeTrees(reader.Generation)) { SerializeTypeTrees = reader.ReadBoolean(); } else { SerializeTypeTrees = true; } m_types = reader.ReadArray(() => new RTTIBaseClassDescriptor(SerializeTypeTrees)); if (IsReadUnknown(reader.Generation)) { Unknown = reader.ReadInt32(); } }
public void Read(SerializedFileReader reader) { ClassID = (ClassIDType)reader.ReadInt32(); if (IsReadScriptType(reader.Generation)) { IsStrippedType = reader.ReadBoolean(); ScriptID = reader.ReadInt16(); } else { // For old version it specifies ClassIDType or -ScriptID for MonoBehaviour int uniqueTypeID = (int)ClassID; if (uniqueTypeID < 0) { ClassID = ClassIDType.MonoBehaviour; ScriptID = (short)(-uniqueTypeID - 1); } } if (IsReadHash(reader.Generation)) { if (ClassID == ClassIDType.MonoBehaviour) { ScriptHash.Read(reader); } TypeHash.Read(reader); } // isSerializeTypeTrees if (Tree != null) { Tree.Read(reader); } }
public void Read(SerializedFileReader reader, long stringPosition) { Version = reader.ReadUInt16(); Depth = reader.ReadByte(); IsArray = reader.ReadBoolean(); uint type = reader.ReadUInt32(); uint name = reader.ReadUInt32(); ByteSize = reader.ReadInt32(); Index = reader.ReadInt32(); MetaFlag = reader.ReadUInt32(); Type = ReadString(reader, stringPosition, type); Name = ReadString(reader, stringPosition, name); }
public void Read(SerializedFileReader reader, long stringPosition) { Version = reader.ReadUInt16(); Depth = reader.ReadByte(); IsArray = reader.ReadBoolean(); uint type = reader.ReadUInt32(); uint name = reader.ReadUInt32(); ByteSize = reader.ReadInt32(); Index = reader.ReadInt32(); MetaFlag = (TransferMetaFlags)reader.ReadUInt32(); if (IsReadUnknown(reader.Generation)) { Unknown1 = reader.ReadUInt32(); Unknown2 = reader.ReadUInt32(); } Type = ReadString(reader, stringPosition, type); Name = ReadString(reader, stringPosition, name); }
public void Read(SerializedFileReader reader) { if (IsReadSignature(reader.Generation)) { string signature = reader.ReadStringZeroTerm(); Version.Parse(signature); #warning HACK: TEMP: if (Version == new Version(5, 6, 4, VersionType.Patch, 1)) { if (FilenameUtils.IsDefaultResource(Name)) { Version = new Version(5, 6, 5, VersionType.Final); } } } if (IsReadAttributes(reader.Generation)) { Platform = (Platform)reader.ReadUInt32(); if (!Enum.IsDefined(typeof(Platform), Platform)) { throw new Exception($"Unsuported platform {Platform} for asset file '{Name}'"); } } if (IsReadSerializeTypeTrees(reader.Generation)) { SerializeTypeTrees = reader.ReadBoolean(); } else { SerializeTypeTrees = true; } Types = reader.ReadSerializedArray(() => new RTTIBaseClassDescriptor(SerializeTypeTrees)); if (IsReadUnknown(reader.Generation)) { Unknown = reader.ReadInt32(); } }