public static EmbeddedGameObjectTableHead ReadEntry(IOMemoryStream ms, UAssetFile f) { //Read in EmbeddedGameObjectTableHead g = new EmbeddedGameObjectTableHead(); g.entryLocation = ms.position; g.id = ms.ReadInt(); g.unknown2 = ms.ReadInt(); g.unknown3 = ms.ReadInt(); g.type = ms.ReadNameTableEntry(f); g.unknown4 = ms.ReadInt(); g.unknown5 = ms.ReadInt(); g.dataLength = ms.ReadInt(); g.dataLocation = ms.ReadInt(); g.unknown6 = ms.ReadInt(); g.unknown7 = ms.ReadInt(); g.unknown8 = ms.ReadInt(); g.unknown9 = ms.ReadInt(); g.unknown10 = ms.ReadInt(); g.unknown11 = ms.ReadInt(); g.unknown12 = ms.ReadInt(); g.unknown13 = ms.ReadInt(); g.unknown14 = ms.ReadInt(); return(g); }
void ReadImageProperties() { //Find the embedded game object with the data EmbeddedGameObjectTableHead result = null; foreach (var r in gameObjectEmbeds) { if (r.type == classname) { result = r; } } //Crash if not correct if (result == null) { throw new Exception("Could not find image property data."); } //Go to stream.position = result.dataLocation; //Read properties = UProperty.ReadProperties(stream, this, null, false); }
void ReadDefaultProperties() { //Find the embedded game object with the data EmbeddedGameObjectTableHead result = FindEmbeddedObjectByType($"Default__{classname}_C"); //Go to stream.position = result.dataLocation; //Read properties = UProperty.ReadProperties(stream, this, null, false); }
void ReadEmbeddedGameObjectReferences() { //Starts directly after the referenced GameObject table. Assume we're already there gameObjectEmbeds = new EmbeddedGameObjectTableHead[embeddedGameObjectCount]; for (int i = 0; i < embeddedGameObjectCount; i++) { EmbeddedGameObjectTableHead h = EmbeddedGameObjectTableHead.ReadEntry(stream, this); gameObjectEmbeds[i] = h; DebugDump($"Game Object Embed {i} @ {h.entryLocation}", ConsoleColor.Magenta, "id", h.id.ToString(), "u2", h.unknown2.ToString(), "u3", h.unknown3.ToString(), "type", h.type, "u4", h.unknown4.ToString(), "u5", h.unknown5.ToString(), "length", h.dataLength.ToString(), "location", h.dataLocation.ToString(), "u6", h.unknown6.ToString(), "u7", h.unknown7.ToString(), "u8", h.unknown8.ToString(), "u9", h.unknown9.ToString(), "u10", h.unknown10.ToString(), "u11", h.unknown11.ToString(), "u12", h.unknown12.ToString(), "u13", h.unknown13.ToString(), "u14", h.unknown14.ToString()); } }
void ReadMetadataProperties() { //Find the embedded game object with the data EmbeddedGameObjectTableHead result = FindEmbeddedObjectByType($"{classname}"); //Go to stream.position = result.dataLocation; //Read metadata = UProperty.ReadProperties(stream, this, null, false); var reader = new PropertyReader(metadata); //Get parent class if (reader.HasProperty("ParentClass")) { ObjectProperty parent = reader.GetProperty <ObjectProperty>("ParentClass"); var parentFile = parent.GetReferencedFile(); if (parentFile != null) { //The parent is an object we can read parentClassname = parentFile.classname; parentPath = parentFile.pathname; hasParentUObject = true; } else { //The parent is not a uobject hasParentUObject = false; } } else { hasParentUObject = false; } }