示例#1
0
 public override byte[] Serialize(Game game, Endianness endianness)
 {
     using (var writer = new EndianBinaryWriter(endianness))
     {
         writer.Write(SerializeBase(endianness));
         writer.Write(DamageType);
         writer.Write(Sticky);
         writer.Write(DamageFlags);
         writer.Write(SurfaceType);
         writer.Write(Phys_Pad);
         writer.Write(SlideStart);
         writer.Write(SlideStop);
         writer.Write(PhysicsFlags.FlagValueByte);
         writer.Write(Friction);
         writer.Write(zSurfMatFX.Serialize(game, endianness));
         writer.Write(zSurfColorFX.Serialize(game, endianness));
         writer.Write(TextureAnimFlags.FlagValueInt);
         writer.Write(zSurfTextureAnim1.Serialize(game, endianness));
         writer.Write(zSurfTextureAnim2.Serialize(game, endianness));
         writer.Write(UVEffectsFlags.FlagValueInt);
         writer.Write(zSurfUVFX.Serialize(game, endianness));
         if (game != Game.Scooby)
         {
             writer.Write(zSurfUVFX2.Serialize(game, endianness));
             writer.Write(On);
             writer.Write((byte)0);
             writer.Write((byte)0);
             writer.Write((byte)0);
         }
         writer.Write(OutOfBoundsDelay);
         writer.Write(WalljumpScaleXZ);
         writer.Write(WalljumpScaleY);
         writer.Write(DamageTimer);
         writer.Write(DamageBounce);
         if (game == Game.Scooby)
         {
             writer.Write(UnknownInt);
             writer.Write(On);
             writer.Write((byte)0);
             writer.Write((byte)0);
             writer.Write((byte)0);
         }
         if (game == Game.Incredibles)
         {
             writer.Write(ImpactSound_AssetID);
             writer.Write(DashImpactType);
             writer.Write((byte)0);
             writer.Write((byte)0);
             writer.Write((byte)0);
             writer.Write(DashImpactThrowBack);
             writer.Write(DashSprayMagnitude);
             writer.Write(DashCoolRate);
             writer.Write(DashCoolAmount);
             writer.Write(DashPass);
             writer.Write(DashRampMaxDistance);
             writer.Write(DashRampMinDistance);
             writer.Write(DashRampKeySpeed);
             writer.Write(DashRampMaxHeight);
             writer.Write(DashRampTarget_MovePoint_AssetID);
             writer.Write(DamageAmount);
             writer.Write((int)HitSourceDamageType);
             writer.Write(OffSurface.Serialize(game, endianness));
             writer.Write(OnSurface.Serialize(game, endianness));
             writer.Write(HitDecalData0.Serialize(game, endianness));
             writer.Write(HitDecalData1.Serialize(game, endianness));
             writer.Write(HitDecalData2.Serialize(game, endianness));
             writer.Write(OffSurfaceTime);
             writer.Write(SwimmableSurface);
             writer.Write(DashFall);
             writer.Write(NeedButtonPress);
             writer.Write(DashAttack);
             writer.Write(FootstepDecals);
             writer.Write(0);
             writer.Write(DrivingSurfaceType);
             writer.Write((byte)0);
             writer.Write((byte)0);
         }
         writer.Write(SerializeLinks(endianness));
         return(writer.ToArray());
     }
 }