docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct PrioChunk

    Structure that contains the ghost ArchetypeChunk to serialize. Each chunk has its own priority, that is calculated based on the importance scaling factor (set for each ghost prefab at authoring time) and that can be further scaled using a custom BatchScaleImportanceFunction.

    Implements
    IComparable<PrioChunk>
    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
    public struct PrioChunk : IComparable<PrioChunk>

    Fields

    chunk

    The ghost chunk that should be processed.

    Declaration
    public ArchetypeChunk chunk
    Field Value
    Type Description
    ArchetypeChunk

    isRelevant

    Fast-path denoting the relevancy of the entire chunk.

    Declaration
    public bool isRelevant
    Field Value
    Type Description
    bool
    Remarks

    Defaults to true when relevancy is in mode Disabled or SetIsIrrelevant, otherwise defaults to false.

    When using this bool, there is no need to write ghost instances into the global `GhostRelevancySet`, unless you need to add an exception (e.g. a ghost that is very far away from the player, yet should remain relevant).

    Note: Why not use priority to denote relevancy? Because relevancy still requires the chunk to be processed occassionally. In other words; there is a risk of breaking relevancy by forcing the importance to be artificially low.

    priority

    The priority of the chunk. When using the BatchScaleImportanceFunction scaling, it is the method responsibility to update this with the scaled priority.

    Declaration
    public int priority
    Field Value
    Type Description
    int

    Methods

    CompareTo(PrioChunk)

    Used for sorting the based on the priority in descending order.

    Declaration
    public int CompareTo(PrioChunk other)
    Parameters
    Type Name Description
    PrioChunk other

    Prio chunk

    Returns
    Type Description
    int

    Descending order.

    Implements

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