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
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
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. |