public void ToBytes(BinaryWriter writer) { writer.Write(MinQuantity); writer.Write(AddQuantity); MinPos.ToBytes(writer); AddPos.ToBytes(writer); MinVelocity.Write(writer); AddVelocity.Write(writer); writer.Write(LifeLength); writer.Write(GravityEffect); writer.Write(MinSize); writer.Write(MaxSize); writer.Write(Color); writer.Write(VertexFlags); writer.Write((int)ParticleModel); writer.Write(ShouldDieInAir); writer.Write(ShouldDieInLiquid); writer.Write(OpacityEvolve == null); if (OpacityEvolve != null) { OpacityEvolve.ToBytes(writer); } writer.Write(RedEvolve == null); if (RedEvolve != null) { RedEvolve.ToBytes(writer); } writer.Write(GreenEvolve == null); if (GreenEvolve != null) { GreenEvolve.ToBytes(writer); } writer.Write(BlueEvolve == null); if (BlueEvolve != null) { BlueEvolve.ToBytes(writer); } writer.Write(SizeEvolve == null); if (SizeEvolve != null) { SizeEvolve.ToBytes(writer); } writer.Write(SelfPropelled); writer.Write(ColorByBlock == null); if (ColorByBlock != null) { writer.Write(ColorByBlock.BlockId); } writer.Write(ClimateColorMap == null); if (ClimateColorMap != null) { writer.Write(ClimateColorMap); } writer.Write(SeasonColorMap == null); if (SeasonColorMap != null) { writer.Write(SeasonColorMap); } }