docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct GhostReceiveSystem

    System present only in clients worlds, receive and decode the ghost snapshosts sent by the server.

    When a new snapshost is received, the system will start decoding the packet protocol by extracting:

    -the list of ghost that need to despawned

    -for each serialized ghost, it delta-compressed or uncompressed state

    The system will schedule spawning and despawning ghosts requests, by using the GhostSpawnBuffer, and GhostDespawnQueues respectively.

    When a new state snapshot is received for a ghost that has been already spawned (see SpawnedGhostEntityMap), the state is deserialized and added to the entity SnapshotDataBuffer history buffer.

    The received snapshot are recorded into the NetworkSnapshotAck, that will then used to send back to the server, as part of the command stream, the latest received snapshot by the client.

    Implements
    ISystem
    ISystemCompilerGenerated
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation|WorldSystemFilterFlags.ThinClientSimulation, WorldSystemFilterFlags.Default)]
    [UpdateInGroup(typeof(GhostSimulationSystemGroup))]
    [UpdateAfter(typeof(PrespawnGhostSystemGroup))]
    [UpdateAfter(typeof(GhostCollectionSystem))]
    [UpdateAfter(typeof(NetDebugSystem))]
    [BurstCompile]
    public struct GhostReceiveSystem : ISystem, ISystemCompilerGenerated

    Methods

    OnCreate(ref SystemState)

    Declaration
    public void OnCreate(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    OnCreateForCompiler(ref SystemState)

    Declaration
    public void OnCreateForCompiler(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    OnDestroy(ref SystemState)

    Declaration
    [BurstCompile]
    public void OnDestroy(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    OnUpdate(ref SystemState)

    Declaration
    [BurstCompile]
    public void OnUpdate(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    Implements

    Unity.Entities.ISystem
    Unity.Entities.ISystemCompilerGenerated
    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)