Vixen
02b45cc4
csharp
public sealed class DataContractAttribute

Marks a type as serialisable. Vixen.Core.Serialization.Generators walks every annotated type at compile time and emits a serializer for it; nothing is discovered by reflection at run time (ADR-002).

Read the guide page for this →

As a annotation

Valid on
Class, Struct, Enum, Interface

Remarks

Serialisation is opt-in at the type level and opt-out at the member level: an annotated type serialises its public fields and read/write properties unless they carry DataMemberIgnoreAttribute.

Fields and properties (3)

  • public string? Alias

    Stable name written to the serialised form. Defaults to the type's name, which means a type rename breaks existing data — set this once and the type can be renamed freely.

  • public bool Inherited

    Whether types deriving from this one are contracts too without repeating the attribute. Off by default: silently serialising a subclass that was never designed for it is the more expensive mistake.

  • public int SerializedVersion

    Schema version of the contract, written into the serialised form so a reader can migrate older data. 0 means unversioned.

Methods (2)

  • public DataContractAttribute()

    Marks the type as serialisable under its own name.

  • public DataContractAttribute(string alias)

    Marks the type as serialisable under .

Used by (447, showing 40)

  • BoxCollisionThirdPersonShooter
  • CharacterVisualsThirdPersonShooter
  • GreetingAddressablesRemote
  • SpawnPointThirdPersonShooter
  • AddressableInfoVixen.Core.Yaml
  • AmbientCombineAssetVixen.Rendering.PostFx
  • AnchoredVixen.Core.Reflection.Tests
  • AngularVelocityVixen.Physics
  • AnimationChannelVixen.Rendering
  • AnimationClipContentVixen.Animation
  • AnimationClipDataVixen.Rendering
  • AnimationEventVixen.Animation
  • AnisotropicShadingVixen.Rendering
  • AnisotropyFeatureVixen.Rendering
  • AnnotatedVixen.Core.Tests
  • AnnotatedClassVixen.Core.Serialization.Tests
  • AnnotationTestsVixen.Core.Tests
  • AssetIdVixen.Core
  • AssetMetaVixen.Core.Yaml
  • AssetMetaFixtureVixen.Core.Yaml.Tests
  • AssetReferenceVixen.Core
  • AudioAutomationAssetVixen.Audio
  • AudioBusAutomationAssetVixen.Audio
  • AudioBusParameterAssetVixen.Audio
  • AudioClipVixen.Audio
  • AudioClipRefVixen.Audio
  • AudioCurveAssetVixen.Audio
  • AudioCurvePointAssetVixen.Audio
  • AudioEventAssetVixen.Audio
  • AudioEventLayerAssetVixen.Audio
  • AudioEventRefVixen.Audio
  • AudioEventSpatialAssetVixen.Audio
  • AudioEventVariantAssetVixen.Audio
  • AudioListenerComponentVixen.Audio
  • AudioParameterAssetVixen.Audio
  • AudioReverbZoneRefVixen.Audio
  • AudioScattererAssetVixen.Audio
  • AudioSourceVixen.Audio
  • AudioSpatialVixen.Audio
  • AudioZoneAssetVixen.Audio