Class NetVarContainer
This is a refactor of the original test's NetworkBehaviour INetVarInfo derived NetworkBehaviours
Inherited Members
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
Namespace: Unity.Netcode.RuntimeTests
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 |
---|---|
Int32 |
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 |
---|---|
Boolean |
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(Int32)
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 |
---|---|---|
Int32 | valueToCheck |
Returns
Type | Description |
---|---|
Boolean |
OnNetworkSpawn()
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()