ComponentKeyAttribute.md

March 31, 2024 ยท View on GitHub

Friflo.Engine.ECS

Friflo.Engine.ECS

ComponentKeyAttribute Class

Assign a custom key used for JSON serialization for annotated IComponent and Script types.
If specified key is null The component type is not serialized.

public sealed class ComponentKeyAttribute : System.Attribute

Inheritance System.Object ๐Ÿก’ System.Attribute ๐Ÿก’ ComponentKeyAttribute

Remarks

The attribute is used for:

  • annotated structs implementing IComponent.
  • annotated classes extending Script.

    This enables changing a struct / class name in code without changing the JSON serialization format.
Constructors
ComponentKeyAttribute(string)