Class TypeRegistryEntry
Used to configure the serialization/deserialization code-generation for a specific type (primitive or struct) and combination of GhostFieldAttribute quantized, smooting and sub-type flags. The tuple [Type, Quantized, Smoothing, SubType] is mapped to a template file that contains the code to use to serialize/deserialize this specific type. It is possible so to register for each individual type multiple serialization rules, that can be selected using the GhostFieldAttribute. For example, the default float type (subtype 0) has 4 different serialization rules:
(float, unquantized, Clamp, 0)
(float, unquantized, InterpolateAndExtrapolate, 0)
(float, quantized, Clamp, 0)
(float, quantized, InterpolateAndExtrapolate)
Inherited Members
Namespace: Unity.NetCode.Generators
Assembly: solution.dll
Syntax
public class TypeRegistryEntry
Fields
Name | Description |
---|---|
Composite | State if the type, template pair is a composite type. Must be used only for structs that contains multiple fields of the same type (ex: float3). Whan a type is configured as composite, the Template model is used recursively on all the fields to generate the serialization code, without the need to crate a specific template for the struct itself. |
Quantized | floating point number can be serialized in two ways: - as a full 32bit raw value - as a fixed-point number, with a given precision (see Quantization) The use of quantization requires special handling by the code-generation and in particular the code in the template file must uses certain rules. You should set this flag to true if the type-template combination should be used for quantized types. |
Smoothing | The smoothing supported by this template and type combination. |
SubType | The sub-type value for this specific type=template combination. This is used to map the [type, Quantized, Smooting, Suptype] tuple specified by the GhostFieldAttribute properties to the correct serializer type. |
SupportCommand | State if the type, template pairs can be used when serializing commands. |
Template | Mandatory, the template file to use. Must be relative path to the Asset or Package folder. |
TemplateOverride | Optional, the template file to use to overrides/change the serializaton code present in the base Template file. Must be relative path to the Asset or Package folder. |
Type | Mandatory, the qualified typename of the type (namespace + type name). |