Exemple #1
0
        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();
            }
        }
        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();
            }
        }