Class SerializeEngineComponentsAttribute
- Namespace
- KeenEyes
- Assembly
- KeenEyes.Abstractions.dll
Opts engine-provided components into this assembly's generated ComponentSerializer.
[AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
public sealed class SerializeEngineComponentsAttribute : Attribute
- Inheritance
-
SerializeEngineComponentsAttribute
- Inherited Members
Examples
[assembly: SerializeEngineComponents(typeof(KeenEyes.Common.Transform3D))]
Remarks
The serialization source generator only sees components declared with
[Component(Serializable = true)] in the compiling project. Components that ship
with the engine (for example KeenEyes.Common.Transform3D) are therefore absent
from the generated serializer, and features that read them from snapshots - such as
replay ghost extraction - would silently receive no data.
Applying this attribute makes the generator emit the same AOT-safe serialization code for each listed engine component as it does for project components. Each type must be a struct implementing IComponent. Only the listed types are included; nothing is registered implicitly.
Constructors
SerializeEngineComponentsAttribute(params Type[])
Opts engine-provided components into this assembly's generated ComponentSerializer.
public SerializeEngineComponentsAttribute(params Type[] componentTypes)
Parameters
componentTypesType[]The engine component types to include in the generated serializer.
Examples
[assembly: SerializeEngineComponents(typeof(KeenEyes.Common.Transform3D))]
Remarks
The serialization source generator only sees components declared with
[Component(Serializable = true)] in the compiling project. Components that ship
with the engine (for example KeenEyes.Common.Transform3D) are therefore absent
from the generated serializer, and features that read them from snapshots - such as
replay ghost extraction - would silently receive no data.
Applying this attribute makes the generator emit the same AOT-safe serialization code for each listed engine component as it does for project components. Each type must be a struct implementing IComponent. Only the listed types are included; nothing is registered implicitly.
Properties
ComponentTypes
Gets the engine component types to include in the generated serializer.
public Type[] ComponentTypes { get; }
Property Value
- Type[]