Struct SpawnedGhost
Struct used to uniquely identify a ghost given its id and spawning time.
Implements
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public struct SpawnedGhost : IEquatable<SpawnedGhost>
Constructors
SpawnedGhost(int, NetworkTick)
Construct a SpawnedEntity using the ghost identifier and the spawn tick
Declaration
public SpawnedGhost(int ghostId, NetworkTick spawnTick)
Parameters
Type | Name | Description |
---|---|---|
int | ghostId | Ghost id |
Network |
spawnTick | Spawn tick |
SpawnedGhost(in GhostInstance)
Construct a SpawnedEntity from a Ghost
Declaration
public SpawnedGhost(in GhostInstance ghostInstance)
Parameters
Type | Name | Description |
---|---|---|
Ghost |
ghostInstance | The ghost from which to construct a SpawnedEntity |
Fields
ghostId
The id assigned to the ghost by the server
Declaration
public int ghostId
Field Value
Type | Description |
---|---|
int |
spawnTick
The tick at which the ghost has been spawned by the server
Declaration
public NetworkTick spawnTick
Field Value
Type | Description |
---|---|
Network |
Methods
Equals(SpawnedGhost)
The SpawnedGhost are identical if both id and tick match.
Declaration
public bool Equals(SpawnedGhost ghost)
Parameters
Type | Name | Description |
---|---|---|
Spawned |
ghost | Ghost to compare with |
Returns
Type | Description |
---|---|
bool | Whether ghost id and spawn tick are identical |
GetHashCode()
Produce the hash code for the SpawnedGhost.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | Ghost id |