MLAPI.NetworkObject
A component used to identify that a GameObject in the network
#
InheritanceSystem.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
System.Dynamic.ExpandoObject
#
Inherited MembersMonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.Invoke(String, Single)
MonoBehaviour.InvokeRepeating(String, Single, Single)
MonoBehaviour.CancelInvoke(String)
MonoBehaviour.IsInvoking(String)
MonoBehaviour.StartCoroutine(String)
MonoBehaviour.StartCoroutine(String, Object)
MonoBehaviour.StartCoroutine(IEnumerator)
MonoBehaviour.StartCoroutine_Auto(IEnumerator)
MonoBehaviour.StopCoroutine(IEnumerator)
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopCoroutine(String)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.print(Object)
MonoBehaviour.useGUILayout
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent(Type)
Component.GetComponent<T>()
Component.GetComponent(String)
Component.GetComponentInChildren(Type, Boolean)
Component.GetComponentInChildren(Type)
Component.GetComponentInChildren<T>(Boolean)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren(Type, Boolean)
Component.GetComponentsInChildren(Type)
Component.GetComponentsInChildren<T>(Boolean)
Component.GetComponentsInChildren<T>(Boolean, List<T>)"
Component.GetComponentsInChildren<T>()
Component.GetComponentsInChildren<T>(List<T>)"
Component.GetComponentInParent(Type)
Component.GetComponentInParent<T>()
Component.GetComponentsInParent(Type, Boolean)
Component.GetComponentsInParent(Type)
Component.GetComponentsInParent<T>(Boolean)
Component.GetComponentsInParent<T>(Boolean, List<T>)"
Component.GetComponentsInParent<T>()
Component.GetComponents(Type)
Component.GetComponents(Type, List<Component>)
Component.GetComponents<T>(List<T>)"
Component.GetComponents<T>()
Component.CompareTag(String)
Component.SendMessageUpwards(String, Object, SendMessageOptions)
Component.SendMessageUpwards(String, Object)
Component.SendMessageUpwards(String)
Component.SendMessageUpwards(String, SendMessageOptions)
Component.SendMessage(String, Object)
Component.SendMessage(String)
Component.SendMessage(String, Object, SendMessageOptions)
Component.SendMessage(String, SendMessageOptions)
Component.BroadcastMessage(String, Object, SendMessageOptions)
Component.BroadcastMessage(String, Object)
Component.BroadcastMessage(String)
Component.BroadcastMessage(String, SendMessageOptions)
Component.transform
Component.gameObject
Component.tag
Component.rigidbody
Component.rigidbody2D
Component.camera
Component.light
Component.animation
Component.constantForce
Component.renderer
Component.audio
Component.guiText
Component.networkView
Component.guiElement
Component.guiTexture
Component.collider
Component.collider2D
Component.hingeJoint
Component.particleEmitter
Component.particleSystem
Object.GetInstanceID()
Object.GetHashCode()
Object.Equals(Object)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate(Object, Transform, Boolean)
Object.Instantiate<T>(T)"
Object.Instantiate<T>(T, Vector3, Quaternion)"
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)"
Object.Instantiate<T>(T, Transform)"
Object.Instantiate<T>(T, Transform, Boolean)"
Object.Destroy(Object, Single)
Object.Destroy(Object)
Object.DestroyImmediate(Object, Boolean)
Object.DestroyImmediate(Object)
Object.FindObjectsOfType(Type)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object, Single)
Object.DestroyObject(Object)
Object.FindSceneObjectsOfType(Type)
Object.FindObjectsOfTypeIncludingAssets(Type)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.FindObjectsOfTypeAll(Type)
Object.FindObjectOfType(Type)
Object.ToString()
Object.name
Object.hideFlags
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
#
Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
Fields#
AlwaysReplicateAsRootIf true, the object will always be replicated as root on clients and the parent will be ignored.
#
Declaration#
Field ValueType | Description |
---|---|
System.Boolean |
#
CheckObjectVisibilityDelegate invoked when the MLAPI needs to know if the object should be visible to a client, if null it will assume true
#
Declaration#
Field ValueType | Description |
---|---|
NetworkObject.VisibilityDelegate |
#
DontDestroyWithOwnerWhether or not to destroy this object if it's owner is destroyed. If false, the objects ownership will be given to the server.
#
Declaration#
Field ValueType | Description |
---|---|
System.Boolean |
#
IncludeTransformWhenSpawningDelegate invoked when the MLAPI needs to know if it should include the transform when spawning the object, if null it will assume true
#
Declaration#
Field ValueType | Description |
---|---|
NetworkObject.SpawnDelegate |
#
NetworkInstanceIdInstanceId 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
#
Declaration#
Field ValueType | Description |
---|---|
System.UInt64 |
#
PrefabHashThe 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
#
Declaration#
Field ValueType | Description |
---|---|
System.UInt64 |
#
PrefabHashGeneratorThe 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
#
Declaration#
Field ValueType | Description |
---|---|
System.String |
#
Properties#
DestroyWithSceneGets whether or not the object should be automatically removed when the scene is unloaded.
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsLocalPlayerGets if the object is the the personal clients player object
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsOwnedByServerGets Whether or not the object is owned by anyone
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsOwnerGets if the object is owned by the local player or if the object is the local player object
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsPlayerObjectGets if this object is a player object
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
IsSceneObjectGets if the object is a SceneObject, null if it's not yet spawned but is a scene object.
#
Declaration#
Property ValueType | Description |
---|---|
System.Nullable<System.Boolean> |
#
IsSpawnedGets if the object has yet been spawned across the network
#
Declaration#
Property ValueType | Description |
---|---|
System.Boolean |
#
NetworkManagerGets the NetworkManager that owns this NetworkObject instance
#
Declaration#
Property ValueType | Description |
---|---|
NetworkManager |
#
NetworkObjectIdGets the unique Id of this object that is synced across the network
#
Declaration#
Property ValueType | Description |
---|---|
System.UInt64 |
#
OwnerClientIdGets the ClientId of the owner of this NetworkObject
#
Declaration#
Property ValueType | Description |
---|---|
System.UInt64 |
#
Methods#
ChangeOwnership(UInt64)Changes the owner of the object. Can only be called from server
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | newOwnerClientId | The new owner clientId |
#
Despawn(Boolean)Despawns this GameObject and destroys it for other clients. This should be used if the object should be kept on the server
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.Boolean | destroy |
#
GetObservers()Returns Observers enumerator
#
Declaration#
ReturnsType | Description |
---|---|
System.Collections.Generic.HashSet.Enumerator<> | Observers enumerator |
#
IsNetworkVisibleTo(UInt64)Whether or not this object is visible to a specific client
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | clientId | The clientId of the client |
#
ReturnsType | Description |
---|---|
System.Boolean | True if the client knows about the object |
#
NetworkHide(List<NetworkObject>, UInt64)Hides a list of objects from a client
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.Collections.Generic.List<NetworkObject> | networkObjects | The objects to hide |
System.UInt64 | clientId | The client to hide the objects from |
#
NetworkHide(UInt64)Hides a object from a specific client
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | clientId | The client to hide the object for |
#
NetworkShow(List<NetworkObject>, UInt64, Stream)Shows a list of previously hidden objects to a client
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.Collections.Generic.List<NetworkObject> | networkObjects | The objects to show |
System.UInt64 | clientId | The client to show the objects to |
System.IO.Stream | payload | An optional payload to send as part of the spawns |
#
NetworkShow(UInt64, Stream)Shows a previously hidden object to a client
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | clientId | The client to show the object to |
System.IO.Stream | payload | An optional payload to send as part of the spawn |
#
RemoveOwnership()Removes all ownership of an object from any client. Can only be called from server
#
Declaration#
Spawn(Stream, Boolean)Spawns this GameObject across the network. Can only be called from the Server
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.IO.Stream | spawnPayload | The writer containing the spawn payload |
System.Boolean | destroyWithScene | Should the object be destroyd when the scene is changed |
#
SpawnAsPlayerObject(UInt64, Stream, Boolean)Spawns an object across the network and makes it the player object for the given client
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | clientId | The clientId whos player object this is |
System.IO.Stream | spawnPayload | The writer containing the spawn payload |
System.Boolean | destroyWithScene | Should the object be destroyd when the scene is changed |
#
SpawnWithOwnership(UInt64, Stream, Boolean)Spawns an object across the network with a given owner. Can only be called from server
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | clientId | The clientId to own the object |
System.IO.Stream | spawnPayload | The writer containing the spawn payload |
System.Boolean | destroyWithScene | Should the object be destroyd when the scene is changed |