Class GhostComponentUtilities
Utility methods for working with GhostComponents.
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public static class GhostComponentUtilities
Methods
GetDebugTypeName(ComponentType)
Retrieve the component name as Unity.Collections.NativeText. The method is burst compatible.
Declaration
public static NativeText.ReadOnly GetDebugTypeName(this ComponentType self)
Parameters
Type | Name | Description |
---|---|---|
ComponentType | self |
Returns
Type | Description |
---|---|
NativeText.ReadOnly | The component name. |
GetFirstGhostTypeId(NativeArray<GhostInstance>)
Find the first valid ghost type id in an array of ghost components. Pre-spawned ghosts have type id -1.
Declaration
public static int GetFirstGhostTypeId(this NativeArray<GhostInstance> self)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<GhostInstance> | self |
Returns
Type | Description |
---|---|
int | The ghost type index if a ghost with a valid type is found, -1 otherwise |
GetFirstGhostTypeId(NativeArray<GhostInstance>, out int)
Find the first valid ghost type id in an array of ghost components. Pre-spawned ghosts have type id -1. This method returns -1 if no ghost type id is found.
Declaration
public static int GetFirstGhostTypeId(this NativeArray<GhostInstance> self, out int firstGhost)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<GhostInstance> | self | |
int | firstGhost | The first valid ghost type index found will be stored in this variable. |
Returns
Type | Description |
---|---|
int | A valid ghost type id, or -1 if no ghost type id was found. |