public void Read(SerializedFileStream stream) { Type = stream.ReadStringZeroTerm(); Name = stream.ReadStringZeroTerm(); ByteSize = stream.ReadInt32(); Index = stream.ReadInt32(); IsArray = stream.ReadInt32() != 0; Version = stream.ReadInt32(); MetaFlag = stream.ReadUInt32(); }
public void Read(SerializedFileStream stream) { if (IsReadAssetName(stream.Generation)) { AssetPath = stream.ReadStringZeroTerm(); } if (IsReadHash(stream.Generation)) { Hash.Read(stream); Type = (AssetType)stream.ReadInt32(); } FilePath = stream.ReadStringZeroTerm(); }
public void Read(SerializedFileStream stream) { if (IsReadAssetName(stream.Generation)) { AssetPath = stream.ReadStringZeroTerm(); } if (IsReadHash(stream.Generation)) { Hash.Read(stream); Type = (AssetType)stream.ReadInt32(); } FilePathOrigin = stream.ReadStringZeroTerm(); FilePath = FilenameUtils.FixFileIdentifier(FilePathOrigin); }
public void Read(SerializedFileStream stream) { if (IsReadSignature(stream.Generation)) { string signature = stream.ReadStringZeroTerm(); Version.Parse(signature); } if (IsReadAttributes(stream.Generation)) { Platform = (Platform)stream.ReadUInt32(); if (!Enum.IsDefined(typeof(Platform), Platform)) { throw new Exception($"Unsuported platform {Platform} for asset file '{Name}'"); } } if (IsReadSerializeTypeTrees(stream.Generation)) { SerializeTypeTrees = stream.ReadBoolean(); } else { SerializeTypeTrees = true; } m_types = stream.ReadArray(() => new RTTIBaseClassDescriptor(SerializeTypeTrees)); if (IsReadUnknown(stream.Generation)) { Unknown = stream.ReadInt32(); } }
private static string ReadString(SerializedFileStream stream, long stringPosition, uint value) { bool isCustomType = (value & 0x80000000) == 0; if (isCustomType) { long position = stream.BaseStream.Position; stream.BaseStream.Position = stringPosition + value; string stringValue = stream.ReadStringZeroTerm(); stream.BaseStream.Position = position; return(stringValue); } else { uint type = value & 0x7FFFFFFF; TreeNodeType nodeType = (TreeNodeType)type; if (!Enum.IsDefined(typeof(TreeNodeType), nodeType)) { throw new Exception($"Unsupported asset class type name '{nodeType}''"); } return(nodeType.ToTypeString()); } }
public void Read(SerializedFileStream stream) { Hierarchy.Read(stream); int count = stream.ReadInt32(); m_objects = new Dictionary <long, ObjectInfo>(count); for (int i = 0; i < count; i++) { ObjectInfo objectInfo = new ObjectInfo(); objectInfo.Read(stream); m_objects.Add(objectInfo.PathID, objectInfo); } if (IsReadPreload(stream.Generation)) { m_preloads = stream.ReadArray <ObjectPtr>(); } m_dependencies = stream.ReadArray <FileIdentifier>(); if (IsReadUnknown(stream.Generation)) { Unknown = stream.ReadStringZeroTerm(); } }