public override void Deserialize(BSReader reader) { base.Deserialize(reader); this.UnkUInt06 = reader.ReadUInt32(); this.UnkUInt07 = reader.ReadUInt32(); this.UnkUInt08 = reader.ReadUInt32(); var gradientKeyCount = reader.ReadInt32(); for (int i = 0; i < gradientKeyCount; i++) { this.GradientKeys.Add(reader.Deserialize <GradientKey>()); } if ((this.UnkUInt07 & 4) != 0) { var curveKeyCount = reader.ReadInt32(); for (int i = 0; i < curveKeyCount; i++) { this.CurveKeys.Add(reader.Deserialize <CurveKey>()); } } this.UnkUInt09 = reader.ReadUInt32(); this.UnkUInt10 = reader.ReadUInt32(); // 1 this.UnkUInt11 = reader.ReadUInt32(); // 1 this.UnkUInt12 = reader.ReadUInt32(); this.UnkUInt13 = reader.ReadUInt32(); // 262661 ? this.UnkUInt14 = reader.ReadUInt32(); // 33686530 ? this.UnkUInt15 = reader.ReadUInt32(); // 3361998720 ? this.UnkUInt16 = reader.ReadUInt32(); // 1065353216 ? this.UnkUInt17 = reader.ReadUInt32(); // 1 }
public override void Deserialize(BSReader reader) { base.Deserialize(reader); // Check working set var soundSetCount = reader.ReadInt32(); if (soundSetCount <= 0) { return; } // Continue reading this.UnkUInt06 = reader.ReadUInt32(); this.UnkUInt07 = reader.ReadUInt32(); this.UnkUInt08 = reader.ReadUInt32(); this.UnkFloat02 = reader.ReadSingle(); this.UnkFloat03 = reader.ReadSingle(); this.UnkUInt09 = reader.ReadUInt32(); this.UnkUInt10 = reader.ReadUInt32(); this.UnkUInt11 = reader.ReadUInt32(); this.UnkUInt12 = reader.ReadUInt32(); this.UnkUInt13 = reader.ReadUInt32(); this.UnkUInt14 = reader.ReadUInt32(); for (int i = 0; i < soundSetCount; i++) { this.SoundSet.Add(reader.Deserialize <ModDataSoundSet>()); } }
public void Deserialize(BSReader reader) { this.Name = reader.ReadString(); var aniTypeDataCount = reader.ReadInt32(); for (int i = 0; i < aniTypeDataCount; i++) { this.AniTypeDataList.Add(reader.Deserialize <PrimAniTypeData>()); } }
public override void Deserialize(BSReader reader) { base.Deserialize(reader); var particleCount = reader.ReadInt32(); for (int i = 0; i < particleCount; i++) { this.Particles.Add(reader.Deserialize <ModDataParticleConfig>()); } }
public void Deserialize(BSReader reader) { this.Name = reader.ReadString(); var trackCount = reader.ReadInt32(); for (int i = 0; i < trackCount; i++) { if (reader.ReadUInt32() == 0) { continue; } this.Tracks.Add(reader.Deserialize <ModDataSoundTrack>()); } }
public void Deserialize(BSReader reader) { this.Type = (PrimAnimationType)reader.ReadInt32(); this.PrimAnimationIndex = reader.ReadInt32(); var eventCount = reader.ReadInt32(); for (int i = 0; i < eventCount; i++) { this.Events.Add(reader.Deserialize <PrimAnimationEvent>()); } var walkPointCount = reader.ReadInt32(); this.WalkLength = reader.ReadFloat(); for (int i = 0; i < walkPointCount; i++) { this.WalkGraph.Add(reader.ReadVector2()); } }
public void Load(Stream stream) { // Read file structure using (var reader = new BSReader(stream)) { var signature = reader.ReadString(12); if (signature != LatestSignature) { // TODO: Migrate old version to current if possible. throw new NotSupportedException($"Migration from '{signature}' not supported."); } // Materials var mtrlCount = reader.ReadInt32(); Materials = new List <PrimMtrl>(mtrlCount); for (int i = 0; i < mtrlCount; i++) { this.Materials.Add(reader.Deserialize <PrimMtrl>()); } } }
public void Load(Stream stream) { // Read file structure using (var reader = new BSReader(stream)) { var signature = reader.ReadString(12); if (signature != LatestSignature) { // TODO: Migrate old version to current if possible. throw new NotSupportedException($"Migration from '{signature}' not supported."); } // File offsets (Collision, Resources) reader.SkipRead(8); // Unknown Int01 = reader.ReadUInt32(); Int02 = reader.ReadUInt32(); Int03 = reader.ReadUInt32(); Int04 = reader.ReadUInt32(); Int05 = reader.ReadUInt32(); // Object info this.ObjectInfo = reader.Deserialize <ObjectGeneralInfo>(); // FileOffset.Collision CollisionResourcePath = reader.ReadString(); // FileOffset.Resources var count = reader.ReadInt32(); ResourceSet = new List <string>(count); for (int i = 0; i < count; i++) { ResourceSet.Add(reader.ReadString()); } } }
public void Load(Stream stream) { // Read file structure using (var reader = new BSReader(stream)) { // Signature var signature = reader.ReadString(12); if (signature != LatestSignature) { // TODO: Migrate old version to current if possible. throw new NotSupportedException($"Migration from '{signature}' not supported."); } // File offsets (Material, Mesh, Animation, Skeleton, MeshGroup, AnimationGroup, ModPalette, Collision) reader.SkipRead(32); // Unknown Flags Flag01 = reader.ReadInt32(); Flag02 = reader.ReadInt32(); Flag03 = reader.ReadInt32(); Flag04 = reader.ReadInt32(); Flag05 = reader.ReadInt32(); // Object info this.ObjectInfo = reader.Deserialize <ObjectGeneralInfo>(); // Reserved UnkBuffer = reader.ReadBytes(40); // FileOffset.Collision CollisionMesh = reader.ReadString(); CollisionBox01 = reader.ReadBoundingBoxF(); CollisionBox02 = reader.ReadBoundingBoxF(); UseCollisionMatrix = reader.ReadUInt32() != 0; if (UseCollisionMatrix) { CollisionMatrix = reader.ReadMatrix4x4(); } // FileOffset.Material var count = reader.ReadInt32(); MaterialSet = new List <PrimMtrlSet>(count); for (int i = 0; i < count; i++) { MaterialSet.Add(reader.Deserialize <PrimMtrlSet>()); } // FileOffset.Mesh count = reader.ReadInt32(); MeshSet = new List <PrimMesh>(count); for (int i = 0; i < count; i++) { MeshSet.Add(reader.DeserializeParameterized <PrimMesh>(this.Flag01)); } // FileOffset.Animation AnimationTypeVersion = reader.ReadUInt32(); AnimationTypeUserDefine = reader.ReadUInt32(); count = reader.ReadInt32(); AnimationSet = new List <PrimAnimation>(count); for (int i = 0; i < count; i++) { AnimationSet.Add(reader.Deserialize <PrimAnimation>()); } // FileOffset.Skeleton HasSkeleton = reader.ReadUInt32() != 0; if (HasSkeleton) { SkeletonPath = reader.ReadString(); AttachmentBone = reader.ReadString(); } // FileOffset.MeshGroup count = reader.ReadInt32(); MeshGroups = new List <PrimMeshGroup>(count); for (int i = 0; i < count; i++) { this.MeshGroups.Add(reader.Deserialize <PrimMeshGroup>()); } // FileOffset.AnimationGroup count = reader.ReadInt32(); AnimationGroups = new List <PrimAniGroup>(count); for (int i = 0; i < count; i++) { this.AnimationGroups.Add(reader.Deserialize <PrimAniGroup>()); } // FileOffset.ModPalette count = reader.ReadInt32(); SystemModSets = new List <ModDataSet>(); for (int i = 0; i < count; i++) { SystemModSets.Add(reader.Deserialize <ModDataSet>()); } count = reader.ReadInt32(); AniModSets = new List <ModDataSet>(); for (int i = 0; i < count; i++) { AniModSets.Add(reader.Deserialize <ModDataSet>()); } // ResAttachable ResourceAttachable = reader.DeserializeParameterized <ResAttachable>(ObjectInfo.Type); } }