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

    Show / Hide Table of Contents

    Class CommandDataUtility

    Contains utility methods to add and retrieve commands from ICommandData dynamic buffers.

    Inheritance
    object
    CommandDataUtility
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.NetCode
    Assembly: solution.dll
    Syntax
    public static class CommandDataUtility

    Fields

    Name Description
    k_CommandDataMaxSize

    The maximum number of commands that can be sent in one single command packet.

    Methods

    Name Description
    AddCommandData<T>(DynamicBuffer<T>, T)

    Add an instance of a ICommandData into the command circular buffer. The command buffer capacity if fixed and the Tick is used to find in which slot the command should be put to keep the command buffer sorted. If a command with the same tick already exists in the buffer, it will be overritten

    GetDataAtTick<T>(DynamicBuffer<T>, NetworkTick, out T)

    Get latest command data for given target tick. For example, if command buffer contains ticks 3,4,5,6 and targetTick is 5 it will return tick 5 (latest without going over). If the command buffer is 1,2,3 and targetTick is 5 it will return tick 3.

    GetInputAtIndex<T>(DynamicBuffer<T>, int)

    Get a readonly reference to the input at the given index. Need to be used in safe context, where you know the buffer is not going to be modified. That would invalidate the reference in that case and we can't guaratee the data you are reading is going to be valid anymore.

    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)