Class ScyllaIgnoreAttribute
Marks a field or property to be excluded from Scylla serialization, regardless of its access modifier or any other serialization settings.
Inherited Members
Namespace: Scylla.Core.Util.Serialization
Assembly: ScyllaCore.dll
Syntax
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public sealed class ScyllaIgnoreAttribute : Attribute
Remarks
The Scylla serialization engine discovers members for serialization by scanning all
public fields and properties, as well as non-public members that are explicitly opted
in via ScyllaIncludeAttribute. Applying [ScyllaIgnore] causes
the engine to unconditionally skip that member during both serialization and
deserialization, even if it would otherwise be included.
This attribute is evaluated before all other member-level attributes. A member
decorated with both [ScyllaIgnore] and ScyllaIncludeAttribute
will be excluded - [ScyllaIgnore] always takes precedence.
Compiler-generated property backing fields (names containing angle-bracket characters) are always skipped automatically and do not require this attribute.
Common use cases for this attribute include:
- Cached or computed values that can be reconstructed after deserialization.
- Transient runtime state that must not be persisted.
- Reference fields that would introduce circular references.
- Properties with significant side effects in their getters or setters.
- Unity-specific fields (e.g.,
Transform,GameObject) that are not serializable by the Scylla engine.
public class PlayerData
{
public string Name { get; set; }
public int Level { get; set; }
// Excluded: computed from Level, no need to persist.
[ScyllaIgnore]
public int CachedDamageBonus { get; set; }
// Excluded: Unity reference cannot be serialized by Scylla.
[ScyllaIgnore]
public Transform CachedTransform { get; set; }
}