Mirror Networking
|
NetworkIdentity identifies objects across the network. More...
Public Member Functions | |
delegate void | ClientAuthorityCallback (NetworkConnectionToClient conn, NetworkIdentity identity, bool authorityState) |
The delegate type for the clientAuthorityCallback. | |
bool | AssignClientAuthority (NetworkConnectionToClient conn) |
Assign control of an object to a client via the client's NetworkConnection. More... | |
void | RemoveClientAuthority () |
Removes ownership for an object. More... | |
Static Public Member Functions | |
static NetworkIdentity | GetSceneIdentity (ulong id) |
Gets the NetworkIdentity from the sceneIds dictionary with the corresponding id | |
static void | ResetNextNetworkId () |
Resets nextNetworkId = 1 | |
Public Attributes | |
Dictionary< int, NetworkConnectionToClient > | observers |
The set of network connections (players) that can see this object. More... | |
ulong | sceneId |
Unique identifier for NetworkIdentity objects within a scene, used for spawning scene objects. More... | |
bool | serverOnly |
Make this object only exist when the game is running as a server (or host). More... | |
Visibility | visible = Visibility.Default |
Properties | |
bool | isClient [get, set] |
Returns true if running as a client and this object was spawned by a server. More... | |
bool | isServer [get, set] |
Returns true if NetworkServer.active and server is not stopped. More... | |
bool | isLocalPlayer [get, set] |
Return true if this object represents the player on the local machine. More... | |
bool | isServerOnly [get] |
True if this object only exists on the server More... | |
bool | isClientOnly [get] |
True if this object exists on a client that is not also acting as a server. More... | |
bool | hasAuthority [get, set] |
True on client if that component has been assigned to the client. E.g. player, pets, henchmen. More... | |
uint | netId [get, set] |
The unique network Id of this object (unique at runtime). More... | |
NetworkConnection | connectionToServer [get, set] |
Client's network connection to the server. This is only valid for player objects on the client. More... | |
NetworkConnectionToClient | connectionToClient [get, set] |
Server's network connection to the client. This is only valid for client-owned objects (including the Player object) on the server. More... | |
static Dictionary< uint, NetworkIdentity > | spawned [get] |
All spawned NetworkIdentities by netId. Available on server and client. More... | |
NetworkBehaviour[] | NetworkBehaviours [get] |
Guid | assetId [get, set] |
Prefab GUID used to spawn prefabs across the network. More... | |
bool | SpawnedFromInstantiate [get] |
Events | |
static ClientAuthorityCallback | clientAuthorityCallback |
A callback that can be populated to be notified when the client-authority state of objects changes. More... | |
NetworkIdentity identifies objects across the network.
Definition at line 40 of file NetworkIdentity.cs.
bool Mirror.NetworkIdentity.AssignClientAuthority | ( | NetworkConnectionToClient | conn | ) |
Assign control of an object to a client via the client's NetworkConnection.
Definition at line 1172 of file NetworkIdentity.cs.
void Mirror.NetworkIdentity.RemoveClientAuthority | ( | ) |
Removes ownership for an object.
Definition at line 1206 of file NetworkIdentity.cs.
Dictionary<int, NetworkConnectionToClient> Mirror.NetworkIdentity.observers |
The set of network connections (players) that can see this object.
Definition at line 97 of file NetworkIdentity.cs.
ulong Mirror.NetworkIdentity.sceneId |
Unique identifier for NetworkIdentity objects within a scene, used for spawning scene objects.
Definition at line 105 of file NetworkIdentity.cs.
bool Mirror.NetworkIdentity.serverOnly |
Make this object only exist when the game is running as a server (or host).
Definition at line 110 of file NetworkIdentity.cs.
Visibility Mirror.NetworkIdentity.visible = Visibility.Default |
Definition at line 171 of file NetworkIdentity.cs.
|
getset |
Prefab GUID used to spawn prefabs across the network.
Definition at line 200 of file NetworkIdentity.cs.
|
getset |
Server's network connection to the client. This is only valid for client-owned objects (including the Player object) on the server.
Definition at line 121 of file NetworkIdentity.cs.
|
getset |
Client's network connection to the server. This is only valid for player objects on the client.
Definition at line 118 of file NetworkIdentity.cs.
|
getset |
True on client if that component has been assigned to the client. E.g. player, pets, henchmen.
Definition at line 92 of file NetworkIdentity.cs.
|
getset |
Returns true if running as a client and this object was spawned by a server.
Definition at line 54 of file NetworkIdentity.cs.
|
get |
True if this object exists on a client that is not also acting as a server.
Definition at line 89 of file NetworkIdentity.cs.
|
getset |
Return true if this object represents the player on the local machine.
Definition at line 83 of file NetworkIdentity.cs.
|
getset |
Returns true if NetworkServer.active and server is not stopped.
Definition at line 69 of file NetworkIdentity.cs.
|
get |
True if this object only exists on the server
Definition at line 86 of file NetworkIdentity.cs.
|
getset |
The unique network Id of this object (unique at runtime).
Definition at line 100 of file NetworkIdentity.cs.
|
get |
Definition at line 160 of file NetworkIdentity.cs.
|
staticget |
All spawned NetworkIdentities by netId. Available on server and client.
Definition at line 140 of file NetworkIdentity.cs.
|
get |
Definition at line 304 of file NetworkIdentity.cs.
|
static |
A callback that can be populated to be notified when the client-authority state of objects changes.
Definition at line 300 of file NetworkIdentity.cs.