docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SpawnedGhost

    Struct used to uniquely identify a ghost given its id and spawning time.

    Implements
    IEquatable<SpawnedGhost>
    Inherited Members
    ValueType.Equals(object)
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    public struct SpawnedGhost : IEquatable<SpawnedGhost>

    Constructors

    SpawnedGhost(int, NetworkTick)

    Construct a SpawnedEntity using the ghost identifier and the spawn tick

    Declaration
    public SpawnedGhost(int ghostId, NetworkTick spawnTick)
    Parameters
    Type Name Description
    int ghostId

    Ghost id

    NetworkTick spawnTick

    Spawn tick

    SpawnedGhost(in GhostInstance)

    Construct a SpawnedEntity from a GhostInstance

    Declaration
    public SpawnedGhost(in GhostInstance ghostInstance)
    Parameters
    Type Name Description
    GhostInstance ghostInstance

    The ghost from which to construct a SpawnedEntity

    Fields

    ghostId

    The id assigned to the ghost by the server

    Declaration
    public int ghostId
    Field Value
    Type Description
    int

    spawnTick

    The tick at which the ghost has been spawned by the server

    Declaration
    public NetworkTick spawnTick
    Field Value
    Type Description
    NetworkTick

    Methods

    Equals(SpawnedGhost)

    The SpawnedGhost are identical if both id and tick match.

    Declaration
    public bool Equals(SpawnedGhost ghost)
    Parameters
    Type Name Description
    SpawnedGhost ghost

    Ghost to compare with

    Returns
    Type Description
    bool

    Whether ghost id and spawn tick are identical

    GetHashCode()

    Produce the hash code for the SpawnedGhost.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    Ghost id

    Overrides
    ValueType.GetHashCode()

    Implements

    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2025 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)