Table of Contents

Class NetworkObject

Namespace
Netick.Unity
Assembly
Netick.Unity.dll

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
Object
Component
Behaviour
MonoBehaviour
NetworkObject
Implements
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.transform
Component.gameObject
Component.tag
Object.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.name
Object.hideFlags
Extension Methods

Constructors

NetworkObject()

public NetworkObject()

Properties

BroadPhaseFilter

public BroadPhaseFilter BroadPhaseFilter { get; }

Property Value

BroadPhaseFilter

Engine

public NetickEngine Engine { get; }

Property Value

NetickEngine

Entity

public Entity Entity { get; }

Property Value

Entity

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

bool

Id

public int Id { get; }

Property Value

int

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

NetworkPlayer

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

InterestManagementGroup

IsClient

Returns true if this Engine is a client.

public bool IsClient { get; }

Property Value

bool

IsInputSource

Returns true if this LocalPlayer is providing inputs for this NetworkObject.

public bool IsInputSource { get; }

Property Value

bool

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

bool

IsPrefab

public bool IsPrefab { get; }

Property Value

bool

IsPrefabObject

public bool IsPrefabObject { get; }

Property Value

bool

IsProxy

Returns true if we neither provide inputs nor own this object.

public bool IsProxy { get; }

Property Value

bool

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

bool

IsSceneObject

[SerializeField]
public bool IsSceneObject { get; }

Property Value

bool

IsServer

Returns true if this Engine is the server.

public bool IsServer { get; }

Property Value

bool

IsSpawnPredicted

public bool IsSpawnPredicted { get; }

Property Value

bool

NarrowPhaseFilter

public bool NarrowPhaseFilter { get; }

Property Value

bool

NetickBehaviours

public NetickBehaviour[] NetickBehaviours { get; }

Property Value

NetickBehaviour[]

NetworkedBehaviours

public NetworkBehaviour[] NetworkedBehaviours { get; }

Property Value

NetworkBehaviour[]

Parent

The NetworkObject parent of this object.

public NetworkObject Parent { get; }

Property Value

NetworkObject

PredictionMode

public Relevancy PredictionMode { get; }

Property Value

Relevancy

Sandbox

public NetworkSandbox Sandbox { get; }

Property Value

NetworkSandbox

SpatialPrioritization

public bool SpatialPrioritization { get; }

Property Value

bool

SpawnPredictionKey

public SpawnPredictionKey SpawnPredictionKey { get; }

Property Value

SpawnPredictionKey

SpawnTick

public Tick SpawnTick { get; }

Property Value

Tick

StateSize

Returns the networked state size of this object in bytes.

public int StateSize { get; }

Property Value

int

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

NetworkObjectRef

GetSceneId()

public int GetSceneId()

Returns

int

SetNarrowphaseInterest(NetworkPlayer, bool)

public void SetNarrowphaseInterest(NetworkPlayer player, bool isInterested)

Parameters

player NetworkPlayer
isInterested bool

SetParent(NetworkObject)

[Owner/InputSource Only] Changes the parent of this object.

public void SetParent(NetworkObject obj)

Parameters

obj NetworkObject

The 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()