docs.unity3d.com
    Show / Hide Table of Contents

    Namespace Unity.NetCode.Generators

    Classes

    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)

    UserDefinedTemplates

    UserDefinedTemplates is used to add custom templates to the code-generation system. Add a partial class definition to an AssemblyDefinitionReference (.asmref) referencing Unity.NetCode, implement the Unity.NetCode.Generators.UserDefinedTemplates.RegisterTemplates(System.Collections.Generic.List{Unity.NetCode.Generators.TypeRegistryEntry},System.String) method by adding your new typesto the templates list.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023