Class NetVarContainer
This is a refactor of the original test's NetworkBehaviour INetVarInfo derived NetworkBehaviours
Inherited Members
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: Unity.Netcode.RuntimeTests
Assembly: solution.dll
Syntax
public class NetVarContainer : NetworkBehaviour
Fields
NumberOfNetVarsToCheck
Declaration
public NetVarContainer.NetVarsToCheck NumberOfNetVarsToCheck
Field Value
Type | Description |
---|---|
NetVarContainer.NetVarsToCheck |
ValueToSetNetVarTo
Declaration
public int ValueToSetNetVarTo
Field Value
Type | Description |
---|---|
int |
Methods
AreNetVarsDirty()
Only used on the server side to check the isDirty flag for the NetworkVariables being used for each test iteration
Declaration
public bool AreNetVarsDirty()
Returns
Type | Description |
---|---|
bool |
CreatePrefabGameObject(NetVarCombinationTypes)
Creates a prefab with two instances of this NetworkBehaviour
Declaration
public static GameObject CreatePrefabGameObject(NetVarCombinationTypes netVarsToCheck)
Parameters
Type | Name | Description |
---|---|---|
NetVarCombinationTypes | netVarsToCheck |
Returns
Type | Description |
---|---|
GameObject |
HaveAllValuesChanged(int)
Only used on the client-side for this test, this is used to see if the network variables have changed.
Declaration
public bool HaveAllValuesChanged(int valueToCheck)
Parameters
Type | Name | Description |
---|---|---|
int | valueToCheck |
Returns
Type | Description |
---|---|
bool |
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()
Overrides
SetNetworkVariableValues()
Server side only, sets the NetworkVariables being used to the ValueToSetNetVarTo that is pre-configured when the Network Prefab is created.
Declaration
public void SetNetworkVariableValues()