Struct PrioChunk
Structure that contains the ghost Unity.Entities.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
Inherited Members
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
A relevancy fast-path, enabling you to denote the relevancy of the entire chunk, without having to write individual ghosts into the GhostRelevancySet.
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.
This value acts as a pre-filter, that will be applied to all ghosts within the chunk. When modifying 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 frequently, and prioritization denotes how often that work is performed.
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. |