Class GhostFieldAttribute
Attribute used to specify how and which fields and properties of IComponent
Implements
Inherited Members
Namespace: Unity.NetCode
Assembly: solution.dll
Syntax
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class GhostFieldAttribute : Attribute, _Attribute
Remarks
Note that "enableable components" (IEnableable
Properties
Name | Description |
---|---|
Composite | Only applicable on GhostFieldAttributes applied to a non primitive struct containing multiple fields. If this value is not set (a.k.a. false, the default), a 'change bit' will be included 'per field, for every field inside the nested struct'. There will be no 'change bit' for the struct itself. I.e. If a single field inside the sub-struct changes, only that fields 'change bit' will be set. Otherwise (if this Composite bool is set, a.k.a. true), we instead use a single 'change bit' for 'the entire nested struct'. I.e. If any fields inside the sub-struct change, the single 'change bit' for the entire struct will be set. Check the Serialize/Deserialize code-generated methods in Library\NetCodeGenerated_Backup for examples. |
Max |
The maximum distance between two snapshots for which smoothing will be applied. If the value changes more than this between two received snapshots the smoothing action will not be performed. |
Quantization | Floating point numbers will be multiplied by this number and rounded to an integer, enabling better delta-compression via huffman encoding. Specifying a Quantization is mandatory for floating point numbers and not supported for integer numbers. To send a floating point number unquantized, use 0. Examples: Quantization=0 implies full precision. Quantization=1 implies precision of 1f (i.e. round float values to integers). Quantization=2 implies precision of 0.5f. Quantization=10 implies precision of 0.1f. Quantization=20 implies precision of 0.05f. Quantization=1000 implies precision of 0.001f. |
Send |
Default true. If unset (false), instructs code-generation to not include this field in the serialization data. I.e. Do not replicate this field. This is particularly useful for non primitive members (like structs), which will have all fields serialized by default. |
Smoothing | Denotes how Ghost |
Sub |
Allows you to specify a custom serializer for this GhostField using the Ghost |