docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ClientPopulatePrespawnedGhostsSystem

    Responsible for assigning a unique ghostId to each pre-spawned ghost, and adding the ghost to the spawned ghosts maps. Relies on the previous initializations step to determine the subscene subset to process.

    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(PrespawnGhostSystemGroup))]
    [UpdateAfter(typeof(PrespawnGhostInitializationSystem))]
    [BurstCompile]
    public struct ClientPopulatePrespawnedGhostsSystem : ISystem, ISystemCompilerGenerated
    Remarks

    Clients expect to receive the following as part ot the protocol:

    - The subscene hash and baseline hash for validation.

    - The ghost id range for each subscene.

    ### The Full Prespawn Subscene Sync Protocol

    The Client will eventually receive the subscene data and will store it into the `PrespawnSceneLoaded` collection. The Client (in parallel, before or after) will serialize the prespawn baseline when a new scene is loaded. The Client should validate that:

    - The prespawn scenes are present on the server.

    - That the prespawn ghost count, subscene hash and baseline hash match the one on the server.

    The Client will assign the ghost ids to the prespawns. The Client must notify the server what scene sections has been loaded and initialized.

    Methods

    OnCreate(ref SystemState)

    Declaration
    [BurstCompile]
    public void OnCreate(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state
    See Also
    ServerPopulatePrespawnedGhostsSystem

    OnCreateForCompiler(ref SystemState)

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

    OnUpdate(ref SystemState)

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

    Implements

    Unity.Entities.ISystem
    Unity.Entities.ISystemCompilerGenerated

    See Also

    ServerPopulatePrespawnedGhostsSystem
    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)