internal void Write(EndiannessWriter writer, UInt32 serializationVersion) { writer.WriteAlignedString(Name); writer.WritePPtrArray(PreloadTable, serializationVersion); writer.WriteInt32(Container.Length); foreach (var container in Container) { writer.WriteAlignedString(container.Key); writer.WriteAssetInfo(container.Value, serializationVersion); } writer.WriteAssetInfo(MainAsset, serializationVersion); writer.WriteUInt32(RuntimeCompatibility); writer.WriteAlignedString(AssetBundleName); writer.WriteInt32(DependencyAssetBundleNames.Length); foreach (var dependencyAssetBundleName in DependencyAssetBundleNames) { writer.WriteAlignedString(dependencyAssetBundleName); } writer.WriteBoolean(IsStreamedSceneAssetBundle); writer.Align(4); writer.WriteInt32(ExplicitDataLayout); writer.WriteInt32(PathFlags); writer.WriteInt32(SceneHashes.Count); foreach (var sceneHash in SceneHashes) { writer.WriteString(sceneHash.Key); writer.WriteString(sceneHash.Value); } }
internal void Write(EndiannessWriter writer) { writer.WriteUInt32(MetadataSize); writer.WriteUInt32((UInt32)FileSize); writer.WriteUInt32(Version); writer.WriteUInt32((UInt32)DataOffset); writer.Write(new[] { (byte)Endianness }); // Writing endianness changes from here // What the actual f**k? writer.Endianness = Endianness; writer.Write(Reserved); writer.WriteString(UnityVersion); writer.WriteInt32((Int32)BuildTarget); writer.WriteBoolean(IsTypeTreeEnabled); writer.WriteInt32(SerializedTypes.Length); foreach (var serializedType in SerializedTypes) { writer.WriteInt32(serializedType.ClassID); writer.WriteBoolean(serializedType.IsStrippedType); writer.WriteInt16(serializedType.ScriptTypeIndex); if ((Version < 16 && serializedType.ClassID < 0) || (Version >= 16 && serializedType.ClassID == 114)) { writer.Write(serializedType.ScriptID); //Hash128 } writer.Write(serializedType.OldTypeHash); } writer.WriteInt32(ObjectInfos.Length); foreach (var objectInfo in ObjectInfos) { writer.Align(4); writer.WriteInt64(objectInfo.PathID); writer.WriteInt32((Int32)objectInfo.ByteStart); writer.WriteUInt32(objectInfo.ByteSize); writer.WriteInt32(objectInfo.TypeID); } // Script int scriptCount = 0; writer.WriteInt32(scriptCount); // Externals int externalCount = 0; writer.WriteInt32(externalCount); string userInformation = ""; writer.WriteString(userInformation); }
internal void Write(EndiannessWriter writer) { writer.WriteString(Signature); writer.WriteInt32(Version); writer.WriteString(UnityVersion); writer.WriteString(UnityRevision); writer.WriteInt64(Size); writer.WriteInt32(CompressedBlocksInfoSize); writer.WriteInt32(UncompressedBlocksInfoSize); writer.WriteInt32(Flags); }
internal void Write(EndiannessWriter writer) { writer.Write(UncompressedDataHash); writer.WriteInt32(StorageBlocks.Length); foreach (var storageBlock in StorageBlocks) { writer.WriteUInt32(storageBlock.CompressedSize); writer.WriteUInt32(storageBlock.UncompressedSize); writer.WriteUInt16(storageBlock.Flags); } writer.WriteInt32(Nodes.Length); foreach (var node in Nodes) { writer.WriteInt64(node.Offset); writer.WriteInt64(node.Size); writer.WriteUInt32(node.Flags); writer.WriteString(node.Path); } }