Struct GhostDistanceImportance
This is the default implementation of the GhostImportance API. It computes a distance-based importance scaling factor. I.e. Entities far away from a clients importance focal point (via GhostConnectionPosition) will be sent less often. Further reading: https://docs.unity3d.com/Packages/com.unity.netcode@latest/index.html?subfolder=/manual/optimizations.html#importance-scaling
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
[BurstCompile]
public struct GhostDistanceImportance
Fields
BatchScaleFunctionPointer
Pointer to the BatchScale(IntPtr, IntPtr, IntPtr, ref UnsafeList<PrioChunk>) static method.
Declaration
public static readonly PortableFunctionPointer<GhostImportance.BatchScaleImportanceDelegate> BatchScaleFunctionPointer
Field Value
Type | Description |
---|---|
PortableFunctionPointer<GhostImportance.BatchScaleImportanceDelegate> |
BatchScaleWithRelevancyFunctionPointer
Pointer to the BatchScaleWithRelevancy(IntPtr, IntPtr, IntPtr, ref UnsafeList<PrioChunk>) static method.
Declaration
public static readonly PortableFunctionPointer<GhostImportance.BatchScaleImportanceDelegate> BatchScaleWithRelevancyFunctionPointer
Field Value
Type | Description |
---|---|
PortableFunctionPointer<GhostImportance.BatchScaleImportanceDelegate> |
ScaleFunctionPointer
Pointer to the CalculateDefaultScaledPriority(int, in GhostDistancePartitionShared, in int3) static method.
Declaration
public static readonly PortableFunctionPointer<GhostImportance.ScaleImportanceDelegate> ScaleFunctionPointer
Field Value
Type | Description |
---|---|
PortableFunctionPointer<GhostImportance.ScaleImportanceDelegate> |
Methods
CalculateDefaultScaledPriority(int, in GhostDistancePartitionShared, in int3)
Default implementation of the distance scaling function.
Declaration
public static int CalculateDefaultScaledPriority(int priority, in GhostDistancePartitionShared chunkTile, in int3 centerTile)
Parameters
Type | Name | Description |
---|---|---|
int | priority | The base priority |
GhostDistancePartitionShared | chunkTile | The chunk tile |
int3 | centerTile | The center tile |
Returns
Type | Description |
---|---|
int | The resulting priority |