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
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) |