docs.unity.cn
    Show / Hide Table of Contents

    Struct AutoCommandTarget

    Component that automates command "reading and sending" (for clients) or "writing, using, and broadcasting" (for the server).

    When the AutoCommandTarget component is Enabled, the entity is considered as an input source for ICommandData's for the client and all non empty command buffers present on the entity are serialized into the OutgoingCommandDataStreamBuffer, along with the id of the ghost they are sent to.

    ///

    On the server side, when a command is deserialized from the IncomingCommandDataStreamBuffer, the corresponding entity is looked up, and if the AutoCommandTarget component is enabled, the commands are added to the corresponding input command buffer.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.NetCode
    Syntax
    public struct AutoCommandTarget : IComponentData, IQueryTypeParameter
    Remarks

    To use the AutoCommandTarget, the target entity must have a GhostOwner.

    Fields

    Enabled

    Enabled/Disable the current entity from sending and receiving commands. Multiple entities can be enabled at the same time.

    Declaration
    public bool Enabled
    Field Value
    Type Description
    Boolean
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023