docs.unity3d.com
    Show / Hide Table of Contents

    Class GhostComponentVariationAttribute

    Generate a serialization variantion for a component using the GhostFieldAttribute annotations present in variant declaration. The component variant can be assigned at authoring time using the GhostAuthoringComponent editor. When declaring a variant, all fields that should be serialized must be declared. Any missing field or new field not present in the original struct will not be serialized.

    Inheritance
    Object
    Attribute
    GhostComponentVariationAttribute
    Namespace: Unity.NetCode
    Syntax
    [AttributeUsage(AttributeTargets.Struct)]
    public class GhostComponentVariationAttribute : Attribute, _Attribute

    Constructors

    GhostComponentVariationAttribute(Type, String)

    Initialize and declare the variant for a given component type.

    Declaration
    public GhostComponentVariationAttribute(Type componentType, string displayName = null)
    Parameters
    Type Name Description
    Type componentType
    String displayName
    Exceptions
    Type Condition
    ArgumentException

    Fields

    ComponentType

    Declaration
    public readonly Type ComponentType
    Field Value
    Type Description
    Type

    Properties

    DisplayName

    User friendly name for the variation. Used mainly for UI and logging purpose. If not assigned at construction time, the annotated class name will be used instead.

    Declaration
    public string DisplayName { get; }
    Property Value
    Type Description
    String

    VariantHash

    Declaration
    public ulong VariantHash { get; }
    Property Value
    Type Description
    UInt64
    Back to top
    Terms of use
    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