{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class GhostComponentVariationAttribute | Netcode for Entities | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GhostComponentVariationAttribute

    Generate a serialization variant for a component using the GhostFieldAttribute annotations present in variant declaration. The component variant can be assigned at authoring time using the GhostAuthoringComponent editor.

    Note: This is incompatible with any type implementing DontSupportPrefabOverridesAttribute.

    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
    Implements
    _Attribute
    Inherited Members
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.Equals(object)
    Attribute.GetHashCode()
    Attribute.Match(object)
    Attribute.IsDefaultAttribute()
    Attribute.TypeId
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.NetCode
    Assembly: solution.dll
    Syntax
    [AttributeUsage(AttributeTargets.Struct)]
    public class GhostComponentVariationAttribute : Attribute, _Attribute

    Constructors

    Name Description
    GhostComponentVariationAttribute(Type, string, bool)

    Initialize and declare the variant for a given component type. We can't constrain on a specific interface, thus, the validation is done at compile time in the constructor (for now).

    Fields

    Name Description
    ComponentType

    Type that this variant is overriding. Assigned at construction time.

    Properties

    Name Description
    DisplayName

    User friendly, readable name for the variant. Used mainly for UI and logging purposes. If not assigned at construction time, the annotated class name will be used instead. "Default", "ClientOnly" and "DontSerialize" are not valid names and will be treated as null.

    IsTestVariant

    True if editor-only. Hides it in the user-facing dropdown. If true; we'll set this variant as the default in the editor, assuming we're unable to find a "proper" default.

    VariantHash

    The unique hash for the component variation. The hash is computed at compile time (assigned to the generated serialization class) and then assigned at runtime to the attribute when all the variant are registered by the GhostComponentSerializerCollectionSystemGroup. The hash itself is then used at both edit and runtime to identify the variation used for each component.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)