public void Read(AssetBinaryReader reader, UAsset asset) { Position = new int[3]; AbsolutePosition = new int[3]; if (asset.GetCustomVersion <FFortniteMainBranchObjectVersion>() < FFortniteMainBranchObjectVersion.WorldCompositionTile3DOffset) { Position[0] = reader.ReadInt32(); Position[1] = reader.ReadInt32(); Position[2] = 0; } else { Position[0] = reader.ReadInt32(); Position[1] = reader.ReadInt32(); Position[2] = reader.ReadInt32(); } Bounds = new BoxPropertyData(new FName()); Bounds.Read(reader, false, 0, 0); Layer = new FWorldTileLayer(); Layer.Read(reader, asset); if (asset.EngineVersion >= UE4Version.VER_UE4_WORLD_LEVEL_INFO_UPDATED) { bHideInTileView = reader.ReadInt32() == 1; ParentTilePackageName = reader.ReadFString(); } if (asset.EngineVersion >= UE4Version.VER_UE4_WORLD_LEVEL_INFO_LOD_LIST) { int numEntries = reader.ReadInt32(); LODList = new FWorldTileLODInfo[numEntries]; for (int i = 0; i < numEntries; i++) { LODList[i] = new FWorldTileLODInfo(); LODList[i].Read(reader, asset); } } if (asset.EngineVersion >= UE4Version.VER_UE4_WORLD_LEVEL_INFO_ZORDER) { ZOrder = reader.ReadInt32(); } #pragma warning disable CS0162 // Unreachable code detected if (false) // Ar.GetPortFlags() & PPF_DuplicateForPIE { AbsolutePosition[0] = reader.ReadInt32(); AbsolutePosition[1] = reader.ReadInt32(); AbsolutePosition[2] = reader.ReadInt32(); } #pragma warning restore CS0162 // Unreachable code detected }
public void Write(AssetBinaryWriter writer, UAsset asset) { if (asset.GetCustomVersion <FFortniteMainBranchObjectVersion>() < FFortniteMainBranchObjectVersion.WorldCompositionTile3DOffset) { writer.Write(Position[0]); writer.Write(Position[1]); } else { writer.Write(Position[0]); writer.Write(Position[1]); writer.Write(Position[2]); } Bounds.Write(writer, false); Layer.Write(writer, asset); if (asset.EngineVersion >= UE4Version.VER_UE4_WORLD_LEVEL_INFO_UPDATED) { writer.Write(bHideInTileView ? 1 : 0); writer.Write(ParentTilePackageName); } if (asset.EngineVersion >= UE4Version.VER_UE4_WORLD_LEVEL_INFO_LOD_LIST) { writer.Write(LODList.Length); for (int i = 0; i < LODList.Length; i++) { LODList[i].Write(writer, asset); } } if (asset.EngineVersion >= UE4Version.VER_UE4_WORLD_LEVEL_INFO_ZORDER) { writer.Write(ZOrder); } #pragma warning disable CS0162 // Unreachable code detected if (false) // Ar.GetPortFlags() & PPF_DuplicateForPIE { writer.Write(AbsolutePosition[0]); writer.Write(AbsolutePosition[1]); writer.Write(AbsolutePosition[2]); } #pragma warning restore CS0162 // Unreachable code detected }
public void Write(AssetBinaryWriter writer, UAsset asset) { writer.Write(Names.Count); if (asset.EngineVersion < UE4Version.VER_UE4_TIGHTLY_PACKED_ENUMS) { var namesForSerialization = new Dictionary <long, FName>(); for (int i = 0; i < Names.Count; i++) { namesForSerialization.Add(Names[i].Item2, Names[i].Item1); } for (int i = 0; i < Names.Count; i++) { if (namesForSerialization.ContainsKey(i)) { writer.Write(namesForSerialization[i]); } } } else if (asset.GetCustomVersion <FCoreObjectVersion>() < FCoreObjectVersion.EnumProperties) { for (int i = 0; i < Names.Count; i++) { writer.Write(Names[i].Item1); writer.Write((byte)Names[i].Item2); } } else { for (int i = 0; i < Names.Count; i++) { writer.Write(Names[i].Item1); writer.Write(Names[i].Item2); } } if (asset.EngineVersion < UE4Version.VER_UE4_ENUM_CLASS_SUPPORT) { writer.Write(CppForm == ECppForm.Namespaced ? 1 : 0); } else { writer.Write((byte)CppForm); } }
public void Read(AssetBinaryReader reader, UAsset asset) { if (asset.EngineVersion < UE4Version.VER_UE4_TIGHTLY_PACKED_ENUMS) { int numEntries = reader.ReadInt32(); for (int i = 0; i < numEntries; i++) { FName tempName = reader.ReadFName(); Names.Add(new Tuple <FName, long>(tempName, i)); } } else if (asset.GetCustomVersion <FCoreObjectVersion>() < FCoreObjectVersion.EnumProperties) { int numEntries = reader.ReadInt32(); for (int i = 0; i < numEntries; i++) { FName tempName = reader.ReadFName(); byte tempVal = reader.ReadByte(); Names.Add(new Tuple <FName, long>(tempName, tempVal)); } } else { int numEntries = reader.ReadInt32(); for (int i = 0; i < numEntries; i++) { FName tempName = reader.ReadFName(); long tempVal = reader.ReadInt64(); Names.Add(new Tuple <FName, long>(tempName, tempVal)); } } if (asset.EngineVersion < UE4Version.VER_UE4_ENUM_CLASS_SUPPORT) { bool bIsNamespace = reader.ReadInt32() == 1; CppForm = bIsNamespace ? ECppForm.Namespaced : ECppForm.Regular; } else { CppForm = (ECppForm)reader.ReadByte(); } }