Class NetworkVariableBaseInitializesWhenPersisted.TestBehaviour
Test NetworkBehaviour that updates a NetworkVariable and tracks the time between spawn and when the NetworkVariable is updated.
Inheritance
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: Unity.Netcode.RuntimeTests.dll
Syntax
public class NetworkVariableBaseInitializesWhenPersisted.TestBehaviour : NetworkBehaviour
Fields
TestNetworkVariable
Declaration
public NetworkVariable<int> TestNetworkVariable
Field Value
Type | Description |
---|---|
NetworkVariable<int> |
Properties
LastUpdateDelta
Declaration
public float LastUpdateDelta { get; }
Property Value
Type | Description |
---|---|
float |
SpawnedCount
Declaration
public int SpawnedCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
OnDestroy()
Invoked when the GameObject the NetworkBehaviour is attached to is destroyed. NOTE: If you override this, you should invoke this base class version of this OnDestroy() method.
Declaration
public override void OnDestroy()
Overrides
OnNetworkDespawn()
Gets called when the NetworkObject gets despawned. Is called both on the server and clients.
Declaration
public override void OnNetworkDespawn()
Overrides
OnNetworkPostSpawn()
Gets called after the NetworkObject is spawned. All NetworkBehaviours associated with the NetworkObject will have had OnNetworkSpawn() invoked.
Declaration
protected override void OnNetworkPostSpawn()
Overrides
Remarks
Will be invoked on each NetworkBehaviour associated with the NetworkObject being spawned. All associated NetworkBehaviour components will have had OnNetworkSpawn() invoked on the spawned NetworkObject.
OnNetworkSpawn()
Gets called when the NetworkObject gets spawned, message handlers are ready to be registered and the network is setup.
Declaration
public override void OnNetworkSpawn()