NetworkedBehaviour NetworkedObject NetworkingManager RpcMethod RpcMethod<T1> RpcMethod<T1,T2> RpcMethod<T1,T2,T3> RpcMethod<T1,T2,T3,T4> RpcMethod<T1,T2,T3,T4,T5> RpcMethod<T1,T2,T3,T4,T5,T6> RpcMethod<T1,T2,T3,T4,T5,T6,T7> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31> RpcMethod<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32> ResponseRpcMethod<TResult> ResponseRpcMethod<TResult,T1> ResponseRpcMethod<TResult,T1,T2> ResponseRpcMethod<TResult,T1,T2,T3> ResponseRpcMethod<TResult,T1,T2,T3,T4> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31> ResponseRpcMethod<TResult,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32> VisibilityDelegate ConnectionApprovedDelegate CustomMessageDelegete

NetworkedObject class

Namespace: MLAPI

Assembly: MLAPI.dll

A component used to identify that a GameObject is networked

Public Properties

public ulong NetworkId { get; set; }

Gets the unique ID of this object that is synced across the network

public ulong OwnerClientId { get; set; }

Gets the clientId of the owner of this NetworkedObject

public bool isPlayerObject { get; } Obsolete

Gets if this object is a player object

public bool IsPlayerObject { get; set; }

Gets if this object is a player object

public bool isLocalPlayer { get; } Obsolete

Gets if the object is the the personal clients player object

public bool IsLocalPlayer { get; }

Gets if the object is the the personal clients player object

public bool isOwner { get; } Obsolete

Gets if the object is owned by the local player or if the object is the local player object

public bool IsOwner { get; }

Gets if the object is owned by the local player or if the object is the local player object

public bool isOwnedByServer { get; } Obsolete

Gets Whether or not the object is owned by anyone

public bool IsOwnedByServer { get; }

Gets Whether or not the object is owned by anyone

public bool isSpawned { get; } Obsolete

Gets if the object has yet been spawned across the network

public bool IsSpawned { get; set; }

Gets if the object has yet been spawned across the network

public Nullable<bool> IsSceneObject { get; set; }

Gets if the object is a SceneObject, null if it's not yet spawned but is a scene object.

public bool DestroyWithScene { get; set; }

Gets whether or not the object should be automatically removed when the scene is unloaded.


Inherited Properties

public bool useGUILayout { get; set; }

Inherited from: MonoBehaviour

public bool runInEditMode { get; set; }

Inherited from: MonoBehaviour

public bool enabled { get; set; }

Inherited from: Behaviour

public bool isActiveAndEnabled { get; }

Inherited from: Behaviour

public Transform transform { get; }

Inherited from: Component

public GameObject gameObject { get; }

Inherited from: Component

public string tag { get; set; }

Inherited from: Component

public Component rigidbody { get; } Obsolete

Inherited from: Component

public Component rigidbody2D { get; } Obsolete

Inherited from: Component

public Component camera { get; } Obsolete

Inherited from: Component

public Component light { get; } Obsolete

Inherited from: Component

public Component animation { get; } Obsolete

Inherited from: Component

public Component constantForce { get; } Obsolete

Inherited from: Component

public Component renderer { get; } Obsolete

Inherited from: Component

public Component audio { get; } Obsolete

Inherited from: Component

public Component guiText { get; } Obsolete

Inherited from: Component

public Component networkView { get; } Obsolete

Inherited from: Component

public Component guiElement { get; } Obsolete

Inherited from: Component

public Component guiTexture { get; } Obsolete

Inherited from: Component

public Component collider { get; } Obsolete

Inherited from: Component

public Component collider2D { get; } Obsolete

Inherited from: Component

public Component hingeJoint { get; } Obsolete

Inherited from: Component

public Component particleEmitter { get; } Obsolete

Inherited from: Component

public Component particleSystem { get; } Obsolete

Inherited from: Component

public string name { get; set; }

Inherited from: Object

public HideFlags hideFlags { get; set; }

Inherited from: Object


Public Fields

public ulong NetworkedInstanceId;

InstanceId is the id that is unique to the object and scene for a scene object when UsePrefabSync is false. If UsePrefabSync is true or if it's used on non scene objects, this has no effect. Should not be set manually

public ulong PrefabHash;

The Prefab unique hash. This should not be set my the user but rather changed by editing the PrefabHashGenerator. It has to be the same for all instances of a prefab

public string PrefabHashGenerator;

The generator used to change the PrefabHash. This should be set the same for all instances of a prefab. It has to be unique in relation to other prefabs

public VisibilityDelegate CheckObjectVisibility;

Delegate invoked when the MLAPI needs to know if the object should be visible to a client, if null it will assume true

public bool DontDestroyWithOwner;

Whether or not to destroy this object if it's owner is destroyed. If false, the objects ownership will be given to the server.


Public Constructors

public NetworkedObject();


Public Methods

public Enumerator<ulong> GetObservers();

Returns Observers enumerator

Returns Enumerator<ulong>

Observers enumerator


public bool IsNetworkVisibleTo(ulong clientId);

Whether or not this object is visible to a specific client

Parameters

ulong clientId

The clientId of the client

Returns bool

True if the client knows about the object


public void NetworkShow(ulong clientId, Stream payload);

Shows a previously hidden object to a client

Parameters

ulong clientId

The client to show the object to

Stream payload

An optional payload to send as part of the spawn


public void NetworkHide(ulong clientId);

Hides a object from a specific client

Parameters

ulong clientId

The client to hide the object for


public void Spawn(Stream spawnPayload, bool destroyWithScene);

Spawns this GameObject across the network. Can only be called from the Server

Parameters

Stream spawnPayload

The writer containing the spawn payload

bool destroyWithScene

Should the object be destroyd when the scene is changed


public void UnSpawn();

Unspawns this GameObject and destroys it for other clients. This should be used if the object should be kept on the server


public void SpawnWithOwnership(ulong clientId, Stream spawnPayload, bool destroyWithScene);

Spawns an object across the network with a given owner. Can only be called from server

Parameters

ulong clientId

The clientId to own the object

Stream spawnPayload

The writer containing the spawn payload

bool destroyWithScene

Should the object be destroyd when the scene is changed


public void SpawnAsPlayerObject(ulong clientId, Stream spawnPayload, bool destroyWithScene);

Spawns an object across the network and makes it the player object for the given client

Parameters

ulong clientId

The clientId whos player object this is

Stream spawnPayload

The writer containing the spawn payload

bool destroyWithScene

Should the object be destroyd when the scene is changed


public void RemoveOwnership();

Removes all ownership of an object from any client. Can only be called from server


public void ChangeOwnership(ulong newOwnerClientId);

Changes the owner of the object. Can only be called from server

Parameters

ulong newOwnerClientId

The new owner clientId



Public Static Methods

public static void NetworkShow(List<NetworkedObject> networkedObjects, ulong clientId, Stream payload);

Shows a list of previously hidden objects to a client

Parameters

List<NetworkedObject> networkedObjects

The objects to show

ulong clientId

The client to show the objects to

Stream payload

An optional payload to send as part of the spawns


public static void NetworkHide(List<NetworkedObject> networkedObjects, ulong clientId);

Hides a list of objects from a client

Parameters

List<NetworkedObject> networkedObjects

The objects to hide

ulong clientId

The client to hide the objects from



Inherited Methods

public bool IsInvoking();

Inherited from: MonoBehaviour

public void CancelInvoke();

Inherited from: MonoBehaviour

public void Invoke(string methodName, float time);

Inherited from: MonoBehaviour
Parameters

string methodName

float time


public void InvokeRepeating(string methodName, float time, float repeatRate);

Inherited from: MonoBehaviour
Parameters

string methodName

float time

float repeatRate


public void CancelInvoke(string methodName);

Inherited from: MonoBehaviour
Parameters

string methodName


public bool IsInvoking(string methodName);

Inherited from: MonoBehaviour
Parameters

string methodName


public Coroutine StartCoroutine(string methodName);

Inherited from: MonoBehaviour
Parameters

string methodName


public Coroutine StartCoroutine(string methodName, object value);

Inherited from: MonoBehaviour
Parameters

string methodName

object value


public Coroutine StartCoroutine(IEnumerator routine);

Inherited from: MonoBehaviour
Parameters

IEnumerator routine


public Coroutine StartCoroutine_Auto(IEnumerator routine); Obsolete

Inherited from: MonoBehaviour
Parameters

IEnumerator routine


public void StopCoroutine(IEnumerator routine);

Inherited from: MonoBehaviour
Parameters

IEnumerator routine


public void StopCoroutine(Coroutine routine);

Inherited from: MonoBehaviour
Parameters

Coroutine routine


public void StopCoroutine(string methodName);

Inherited from: MonoBehaviour
Parameters

string methodName


public void StopAllCoroutines();

Inherited from: MonoBehaviour

public Component GetComponent(Type type);

Inherited from: Component
Parameters

Type type


public T GetComponent();

Inherited from: Component

public Component GetComponent(string type);

Inherited from: Component
Parameters

string type


public Component GetComponentInChildren(Type t, bool includeInactive);

Inherited from: Component
Parameters

Type t

bool includeInactive


public Component GetComponentInChildren(Type t);

Inherited from: Component
Parameters

Type t


public T GetComponentInChildren(bool includeInactive);

Inherited from: Component
Parameters

bool includeInactive


public T GetComponentInChildren();

Inherited from: Component

public Component[] GetComponentsInChildren(Type t, bool includeInactive);

Inherited from: Component
Parameters

Type t

bool includeInactive


public Component[] GetComponentsInChildren(Type t);

Inherited from: Component
Parameters

Type t


public T[] GetComponentsInChildren(bool includeInactive);

Inherited from: Component
Parameters

bool includeInactive


public void GetComponentsInChildren(bool includeInactive, List<T> result);

Inherited from: Component
Parameters

bool includeInactive

List<T> result


public T[] GetComponentsInChildren();

Inherited from: Component

public void GetComponentsInChildren(List<T> results);

Inherited from: Component
Parameters

List<T> results


public Component GetComponentInParent(Type t);

Inherited from: Component
Parameters

Type t


public T GetComponentInParent();

Inherited from: Component

public Component[] GetComponentsInParent(Type t, bool includeInactive);

Inherited from: Component
Parameters

Type t

bool includeInactive


public Component[] GetComponentsInParent(Type t);

Inherited from: Component
Parameters

Type t


public T[] GetComponentsInParent(bool includeInactive);

Inherited from: Component
Parameters

bool includeInactive


public void GetComponentsInParent(bool includeInactive, List<T> results);

Inherited from: Component
Parameters

bool includeInactive

List<T> results


public T[] GetComponentsInParent();

Inherited from: Component

public Component[] GetComponents(Type type);

Inherited from: Component
Parameters

Type type


public void GetComponents(Type type, List<Component> results);

Inherited from: Component
Parameters

Type type

List<Component> results


public void GetComponents(List<T> results);

Inherited from: Component
Parameters

List<T> results


public T[] GetComponents();

Inherited from: Component

public bool CompareTag(string tag);

Inherited from: Component
Parameters

string tag


public void SendMessageUpwards(string methodName, object value, SendMessageOptions options);

Inherited from: Component
Parameters

string methodName

object value

SendMessageOptions options


public void SendMessageUpwards(string methodName, object value);

Inherited from: Component
Parameters

string methodName

object value


public void SendMessageUpwards(string methodName);

Inherited from: Component
Parameters

string methodName


public void SendMessageUpwards(string methodName, SendMessageOptions options);

Inherited from: Component
Parameters

string methodName

SendMessageOptions options


public void SendMessage(string methodName, object value);

Inherited from: Component
Parameters

string methodName

object value


public void SendMessage(string methodName);

Inherited from: Component
Parameters

string methodName


public void SendMessage(string methodName, object value, SendMessageOptions options);

Inherited from: Component
Parameters

string methodName

object value

SendMessageOptions options


public void SendMessage(string methodName, SendMessageOptions options);

Inherited from: Component
Parameters

string methodName

SendMessageOptions options


public void BroadcastMessage(string methodName, object parameter, SendMessageOptions options);

Inherited from: Component
Parameters

string methodName

object parameter

SendMessageOptions options


public void BroadcastMessage(string methodName, object parameter);

Inherited from: Component
Parameters

string methodName

object parameter


public void BroadcastMessage(string methodName);

Inherited from: Component
Parameters

string methodName


public void BroadcastMessage(string methodName, SendMessageOptions options);

Inherited from: Component
Parameters

string methodName

SendMessageOptions options


public int GetInstanceID();

Inherited from: Object

public int GetHashCode();

Inherited from: Object

public bool Equals(object other);

Inherited from: Object
Parameters

object other


public string ToString();

Inherited from: Object

public Type GetType();

Inherited from: object