Prowl.Echo gives you fine-grained control over the serialization pipeline through a set of purpose-built attributes. Rather than serializing everything by default, Echo follows a clear set of rules — and these attributes let you override them precisely where needed, without touching your serialization logic.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Echo/llms.txt
Use this file to discover all available pages before exploring further.
Default Serialization Rules
Before diving into the attributes, it helps to understand what Echo serializes without any annotation at all.Serialized by default
Public instance fields declared on the type or any base class
Never serialized
Properties, static fields,
const fields, and readonly fieldsProperties are not serialized. This is intentional — Echo mirrors Unity’s serializer behavior, which serializes fields only. If you expose data through a property backed by a private field, add
[SerializeField] to the backing field.[SerializeField] to opt them in individually.
Attributes Reference
[SerializeField]
Forces a private or protected field into the serialization pipeline. Without this attribute, non-public fields are invisible to Echo.
[SerializeIgnore]
Excludes a public field from serialization entirely. Echo also respects the standard [NonSerialized] attribute, so either works — but [SerializeIgnore] is the Echo-native choice.
Both
[SerializeIgnore] and [NonSerialized] cause the field to be skipped. If you’re writing new code, prefer [SerializeIgnore] for clarity of intent within the Echo ecosystem.[FormerlySerializedAs(string oldName)]
Allows a renamed field to still deserialize from data that was saved under the old name. You can stack multiple [FormerlySerializedAs] attributes on a single field to cover a chain of past names.
HitPoints), then falls back to health, then to hp — in the order they are declared. This lets you rename fields freely across save-file versions without breaking existing data.
[IgnoreOnNull]
Skips writing the field to the serialized output when its value is null. If the field is non-null, it serializes normally. This trims output size for optional data that is typically absent.
Description and Tags are null, they are omitted from the serialized compound entirely. On deserialization, absent fields simply leave the corresponding field at its default value — no error is raised.
[IgnoreOnNull] only affects writing. Reading is unaffected: if the key is present in the data, the field is populated normally regardless of this attribute.[SerializeIf(string conditionMemberName)]
Makes serialization of a field conditional. The named member — a property, field, or parameterless method — is evaluated at runtime; if it returns false, the field is skipped. The condition member must return bool and be accessible (public or non-public) on the same type.
If the condition member cannot be found or does not return
bool, Echo defaults to serializing the field and logs a warning via Serializer.Logger. If the condition member is found but throws an exception during evaluation, Echo still defaults to serializing the field and logs an error instead.
[FixedEchoStructure]
Applied to a class or struct, this attribute tells Echo that the type has a stable, fixed field order and will not change between versions. Echo uses this to enable positional (ordinal-based) serialization, which skips embedding field names in the output — producing significantly smaller and faster output.
[FixedEchoStructure] pairs especially well with [GenerateSerializer] for maximum throughput — see the Performance guide for benchmark results.