Class NetworkObject
Any GameObject which needs to be synced/replicated must have a Network Object component. It’s the component that tells Netick a GameObject is networked. Although not every child GameObject needs it, only the root has to have a Network Object.
[AddComponentMenu("Netick/Network Object")]
[DisallowMultipleComponent]
[SerializeField]
public class NetworkObject : MonoBehaviour, INetickEntity
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourNetworkObject
- Implements
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.transformComponent.gameObjectComponent.tagObject.GetInstanceID()Object.GetHashCode()Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
- Extension Methods
Constructors
NetworkObject()
public NetworkObject()
Properties
BroadPhaseFilter
public BroadPhaseFilter BroadPhaseFilter { get; }
Property Value
Engine
public NetickEngine Engine { get; }
Property Value
Entity
public Entity Entity { get; }
Property Value
HasValidId
Returns true if this NetworkObject has been added to the simulation by Netick, and thus has a valid id.
[SerializeField]
public bool HasValidId { get; }
Property Value
Id
public int Id { get; }
Property Value
InputSource
Returns the source NetworkPlayer (NetworkPeer/ServerConnection) of inputs for this NetworkObject. If the source of inputs is remote (from a client) it returns that ServerConnection, while on the input source itself it returns the local NetworkPlayer.
public NetworkPlayer InputSource { get; set; }
Property Value
InterestGroup
The interest group of this object. This can only be changed if BroadPhaseFilter is set to Custom.
public InterestManagementGroup InterestGroup { get; set; }
Property Value
IsClient
Returns true if this Engine is a client.
public bool IsClient { get; }
Property Value
IsInputSource
Returns true if this LocalPlayer is providing inputs for this NetworkObject.
public bool IsInputSource { get; }
Property Value
IsOwner
Returns true if this Engine is the owner of this Object. In this version of Netick: Server=Owner.
public bool IsOwner { get; }
Property Value
IsPrefab
public bool IsPrefab { get; }
Property Value
IsPrefabObject
public bool IsPrefabObject { get; }
Property Value
IsProxy
Returns true if we neither provide inputs nor own this object.
public bool IsProxy { get; }
Property Value
IsResimulating
Returns true if we are currently resimulating a previous input of the past. On the server, it always returns false since only the clients resimulate.
public bool IsResimulating { get; }
Property Value
IsSceneObject
[SerializeField]
public bool IsSceneObject { get; }
Property Value
IsServer
Returns true if this Engine is the server.
public bool IsServer { get; }
Property Value
IsSpawnPredicted
public bool IsSpawnPredicted { get; }
Property Value
NarrowPhaseFilter
public bool NarrowPhaseFilter { get; }
Property Value
NetickBehaviours
public NetickBehaviour[] NetickBehaviours { get; }
Property Value
NetworkedBehaviours
public NetworkBehaviour[] NetworkedBehaviours { get; }
Property Value
Parent
The NetworkObject parent of this object.
public NetworkObject Parent { get; }
Property Value
PredictionMode
public Relevancy PredictionMode { get; }
Property Value
Sandbox
public NetworkSandbox Sandbox { get; }
Property Value
SpatialPrioritization
public bool SpatialPrioritization { get; }
Property Value
SpawnPredictionKey
public SpawnPredictionKey SpawnPredictionKey { get; }
Property Value
SpawnTick
public Tick SpawnTick { get; }
Property Value
StateSize
Returns the networked state size of this object in bytes.
public int StateSize { get; }
Property Value
Methods
CopyStateTo(byte*)
public void CopyStateTo(byte* target)
Parameters
target
byte*
GetBehaviourById<T>(int)
public T GetBehaviourById<T>(int id) where T : NetworkBehaviour
Parameters
id
int
Returns
- T
Type Parameters
T
GetBehaviour<T>()
public T GetBehaviour<T>() where T : NetworkBehaviour
Returns
- T
Type Parameters
T
GetRef()
public NetworkObjectRef GetRef()
Returns
GetSceneId()
public int GetSceneId()
Returns
SetNarrowphaseInterest(NetworkPlayer, bool)
public void SetNarrowphaseInterest(NetworkPlayer player, bool isInterested)
Parameters
player
NetworkPlayerisInterested
bool
SetParent(NetworkObject)
[Owner/InputSource Only] Changes the parent of this object.
public void SetParent(NetworkObject obj)
Parameters
obj
NetworkObjectThe object which will become the parent of this object.
SetStateFrom(byte*)
Sets the state of this object. Ignores [OnChanged] callbacks when setting the data.
public void SetStateFrom(byte* source)
Parameters
source
byte*
UpdateAoI()
public void UpdateAoI()