{!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} Struct GhostComponentSerializerCollectionData | Netcode for Entities | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct GhostComponentSerializerCollectionData

    GhostComponentSerializerCollectionSystemGroup. Blittable. For internal use only.

    Implements
    IComponentData
    IQueryTypeParameter
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.NetCode
    Assembly: solution.dll
    Syntax
    [BurstCompile]
    public struct GhostComponentSerializerCollectionData : IComponentData, IQueryTypeParameter

    Methods

    Name Description
    AddInputComponent(ComponentType, ComponentType)

    Used by code-generated systems and meant for internal use only. Adds a mapping from an IInputComponentData to the buffer it should use.

    AddSerializationStrategy(ref ComponentTypeSerializationStrategy)

    Used by code-generated systems to register SerializationStrategies. Internal use only.

    AddSerializer(State)

    Used by code-generated systems and meant for internal use only. Adds the generated ghost serializer to GhostComponentSerializer.State collection.

    Dispose()

    Release the allocated resources used to store the ghost serializer strategies and mappings.

    GetAllAvailableSerializationStrategiesForType(ComponentType, ulong, bool)

    Finds all available variants for a given type, applying all variant rules at once.

    Since multiple variants can be present for any given component there are some important use cases that need to be handled.

    Note that, for InputBufferData<T>s, they'll return the variants available to their IInputComponentData authoring struct.

    Note that the number of default variants returned may not be 1 (it could be more or less).

    ThrowIfCollectionNotFinalized(in FixedString512Bytes)

    We have no idea how many code-generated types are left to be registered, so instead, we have a flag that is set when we know ALL of them have been created. If the user queries this collection BEFORE all queries have been created, then they'll get silent errors where GhostFields default to DontSerializeVariant.

    ThrowIfNoHash(ulong, FixedString512Bytes)

    Validation that the SourceGenerators return valid hashes for "default serializers".

    ThrowIfNotInRegistrationPhase(in FixedString512Bytes)

    We have no idea how many code-generated types are left to be registered, so instead, we have a flag that is set when we know ALL of them have been created. If the user queries this collection BEFORE all queries have been created, then they used to get silent errors where GhostFields default to DontSerializeVariant. This throw highlights that user-error.

    TryGetBufferForInputComponent(ComponentType, out ComponentType)

    Lookup a component type to use as a buffer for a given IInputComponentData.

    Validate()

    Validate that all the serialization strategies have a valid SerializerIndex and that all the SerializationStrategyIndex have been set.

    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)