Skip to content

Latest commit

 

History

History
798 lines (796 loc) · 32.3 KB

File metadata and controls

798 lines (796 loc) · 32.3 KB
title NetworkedObject
name NetworkedObject
permalink /api/networked-object/

NetworkedObject ``class``

Namespace: MLAPI

Assembly: MLAPI.dll

A component used to identify that a GameObject is networked

Public Properties

public ``uint`` NetworkId { get; set; }

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

public ``uint`` OwnerClientId { get; set; }

Gets the clientId of the owner of this NetworkedObject

public ``ulong`` NetworkedPrefabHash { get; }

The hash used to identify the NetworkedPrefab, a hash of the NetworkedPrefabName

public ``bool`` isPlayerObject { get; } Obsolete

public ``bool`` IsPlayerObject { get; set; }

Gets if this object is a player object

public ``bool`` isPooledObject { get; } Obsolete

public ``bool`` IsPooledObject { get; set; }

Gets if this object is part of a pool

public ``ushort`` PoolId { get; set; }

Gets the poolId this object is part of

public ``bool`` isLocalPlayer { get; } Obsolete

public ``bool`` IsLocalPlayer { get; }

Gets if the object is the the personal clients player object

public ``bool`` isOwner { get; } Obsolete

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

public ``bool`` IsOwnedByServer { get; }

Gets wheter or not the object is owned by anyone

public ``bool`` isSpawned { get; } Obsolete

public ``bool`` IsSpawned { get; set; }

Gets if the object has yet been spawned across the network


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 ``string`` NetworkedPrefabName;

The name of the NetworkedPrefab

public ``bool`` SceneDelayedSpawn;

When enabled this gameobject will not be spawned on the client until the scene it was originally spawned inside at the server is fully loaded on the client.

public ``bool`` DontDestroyWithOwner;

Wheter 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``](/MLAPI/api/networked-object/)();


Public Methods

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(``uint`` clientId, ``Stream`` spawnPayload, ``bool`` destroyWithScene);

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

Parameters

``uint`` 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(``uint`` clientId, ``Stream`` spawnPayload);

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

Parameters

``uint`` clientId

The clientId whos player object this is

``Stream`` spawnPayload

The writer containing the spawn payload


public ``void`` RemoveOwnership();

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


public ``void`` ChangeOwnership(``uint`` newOwnerClientId);

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

Parameters

``uint`` newOwnerClientId

The new owner clientId



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`` result);

Inherited from: ``Component``
Parameters

``bool`` includeInactive

``List`` result


public ``T[]`` GetComponentsInChildren();

Inherited from: ``Component``

public ``void`` GetComponentsInChildren(``List`` results);

Inherited from: ``Component``
Parameters

``List`` 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`` results);

Inherited from: ``Component``
Parameters

``bool`` includeInactive

``List`` results


public ``T[]`` GetComponentsInParent();

Inherited from: ``Component``

public ``Component[]`` GetComponents(``Type`` type);

Inherited from: ``Component``
Parameters

``Type`` type


public ``void`` GetComponents(``Type`` type, ``List`` results);

Inherited from: ``Component``
Parameters

``Type`` type

``List`` results


public ``void`` GetComponents(``List`` results);

Inherited from: ``Component``
Parameters

``List`` 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``