docs.unity.cn
    Show / Hide Table of Contents

    Struct GhostInstance

    Component signaling an entity which is replicated over the network

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

    Fields

    ghostId

    The id assigned to the ghost by the server. When a ghost is destroyed, its id is recycled and can assigned to new ghosts. For that reason the ghost id cannot be used an unique identifier. The ghostId, spawnTick pairs is instead guaratee to be unique, since at any given point in time, there can be one and only one ghost that have a given id that has been spawned at that specific tick.

    Declaration
    public int ghostId
    Field Value
    Type Description
    Int32

    ghostType

    The ghost prefab type, as index inside the ghost prefab collection.

    Declaration
    public int ghostType
    Field Value
    Type Description
    Int32

    spawnTick

    The tick the entity spawned on the server. Together with ghostId is guaranted to be always unique.

    Declaration
    public NetworkTick spawnTick
    Field Value
    Type Description
    NetworkTick

    Methods

    ToFixedString()

    Returns a human-readable GhostComponent FixedString, containing its values.

    Declaration
    public FixedString128Bytes ToFixedString()
    Returns
    Type Description
    FixedString128Bytes

    A human-readable GhostComponent FixedString, containing its values.

    Operators

    Implicit(in GhostInstance to SpawnedGhost)

    Implicitly convert a GhostComponent to a SpawnedGhost instance.

    Declaration
    public static implicit operator SpawnedGhost(in GhostInstance comp)
    Parameters
    Type Name Description
    GhostInstance comp
    Returns
    Type Description
    SpawnedGhost
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023