Class ObjectNameIdentifier
Used in conjunction with integratioin tests, this NetworkBehaviour derived class is used to provide additional identification information in the name of the spawned objects in order to simplify finding a specific instance. NetcodeIntegrationTest
Inherited Members
Namespace: Unity.Netcode.TestHelpers.Runtime
Assembly: Unity.Netcode.Runtime.Tests.dll
Syntax
public class ObjectNameIdentifier : NetworkBehaviour
Methods
DeRegisterNetworkObject()
Invoke to remove the object from registration.
Declaration
protected void DeRegisterNetworkObject()
OnDestroy()
Invoked when the GameObject the NetworkBehaviour is attached to is destroyed. If you override this, you must always invoke the base class version of this OnDestroy() method.
Declaration
public override void OnDestroy()
Overrides
OnGainedOwnership()
In client-server contexts, this method is invoked on both the server and the local client of the owner when NetworkObject ownership is assigned. In distributed authority contexts, this method is invoked on all clients connected to the session.
Declaration
public override void OnGainedOwnership()
Overrides
OnLostOwnership()
In client-server contexts, this method is invoked on the local client when it loses ownership of the associated NetworkObject and on the server when any client loses ownership. In distributed authority contexts, this method is invoked on all clients connected to the session.
Declaration
public override void OnLostOwnership()
Overrides
OnNetworkDespawn()
Gets called when the NetworkObject gets despawned. This method runs both client and server side.
Declaration
public override void OnNetworkDespawn()
Overrides
OnNetworkSpawn()
Gets called when the NetworkObject gets spawned, message handlers are ready to be registered, and the network is set up.
Declaration
public override void OnNetworkSpawn()
Overrides
RegisterAndLabelNetworkObject()
Invoke to register and label the spawned NetworkObject.
Declaration
protected void RegisterAndLabelNetworkObject()