mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
docs: Updated various documents
This commit is contained in:
parent
f4677ff627
commit
e5dec90499
@ -1,3 +0,0 @@
|
||||
# Facebook Authenticator
|
||||
|
||||
Coming Soon
|
@ -1,3 +0,0 @@
|
||||
# Google Authenticator
|
||||
|
||||
Coming Soon
|
@ -1,3 +0,0 @@
|
||||
# PlayFab Authenticator
|
||||
|
||||
Coming Soon
|
@ -15,9 +15,3 @@ In addition to the Authenticators listed below, you can make your own! Check out
|
||||
|
||||
- [Basic Authenticator](Basic.md)
|
||||
Mirror includes a Basic Authenticator in the Mirror / Authenticators folder which just uses a simple username and password.
|
||||
- [PlayFab Authenticator](PlayFab.md)
|
||||
Coming Soon
|
||||
- [Facebook Authenticator](Facebook.md)
|
||||
Coming Soon
|
||||
- [Google Authenticator](Google.md)
|
||||
Coming Soon
|
||||
|
@ -2,9 +2,3 @@
|
||||
href: index.md
|
||||
- name: Basic Authenticator
|
||||
href: Basic.md
|
||||
- name: PlayFab Authenticator
|
||||
href: PlayFab.md
|
||||
- name: Facebook Authenticator
|
||||
href: Facebook.md
|
||||
- name: Google Authenticator
|
||||
href: Google.md
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkDiscovery
|
||||
# Network Discovery
|
||||
|
||||
Network Discovery uses a UDP broadcast on the LAN enabling clients to find the running server and connect to it.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# NetworkIdentity
|
||||
# Network Identity
|
||||
|
||||
**See also <xref:Mirror.NetworkIdentity> in the API Reference.**
|
||||
|
||||
|
||||
The Network Identity component is at the heart of the Unity networking high-level API. It controls a game object’s unique identity on the network, and it uses that identity to make the networking system aware of the game object. It offers two different options for configuration and they are mutually exclusive, which means either one of the options or none can be checked.
|
||||
- **Server Only**
|
||||
Tick this checkbox to ensure that Unity only spawns the game object on the server, and not on clients.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkManager
|
||||
# Network Manager
|
||||
|
||||
The Network Manager is a component for managing the networking aspects of a multiplayer game.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkManagerHUD
|
||||
# Network Manager HUD
|
||||
|
||||
The Network Manager HUD (“heads-up display”) is a quick-start tool to help you start building your multiplayer game straight away, without first having to build a user interface for game creation/connection/joining. It allows you to jump straight into your game play programming, and means you can build your own version of these controls later in your development schedule.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkProximityChecker
|
||||
# Network Proximity Checker
|
||||
|
||||
The Network Proximity Checker component controls the visibility of game objects for network clients, based on proximity to players.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkRoomManager
|
||||
# Network Room Manager
|
||||
|
||||
\*\*Please see the Room example in the Examples folder in your Mirror folder
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkRoomPlayer
|
||||
# Network Room Player
|
||||
|
||||
The Network Room Player stores per-player state for the [Network Room Manager](NetworkRoomManager.md) while in the room. When using this component, you need to write a script which allows players to indicate they are ready to begin playing, which sets the ReadyToBegin property.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkSceneChecker
|
||||
# Network Scene Checker
|
||||
|
||||
The Network Scene Checker component controls the visibility of game objects for network clients, based on which scene they're in.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkStartPosition
|
||||
# Network Start Position
|
||||
|
||||
To control where players are spawned, you can use the Network Start Position component.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkTransform
|
||||
# Network Transform
|
||||
|
||||
[![Network transform video tutorial](../images/video_tutorial.png)](https://www.youtube.com/watch?v=Z0th49NERl4&list=PLkx8oFug638oBYF5EOwsSS-gOVBXj1dkP&index=3)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# NetworkTransformChild
|
||||
# Network Transform Child
|
||||
|
||||
[![Network transform child video tutorial](../images/video_tutorial.png)](https://www.youtube.com/watch?v=5EgN8IqFfUI&list=PLkx8oFug638oBYF5EOwsSS-gOVBXj1dkP&index=2)
|
||||
|
||||
|
@ -2,27 +2,27 @@
|
||||
|
||||
These core components are included in Mirror:
|
||||
|
||||
- [NetworkAnimator](NetworkAnimator.md)
|
||||
- [Network Animator](NetworkAnimator.md)
|
||||
The Network Animator component allows you to synchronize animation states for networked objects. It synchronizes state and parameters from an Animator Controller.
|
||||
- [NetworkIdentity](NetworkIdentity.md)
|
||||
- [Network Identity](NetworkIdentity.md)
|
||||
The Network Identity component is at the heart of the Mirror networking high-level API. It controls a game object’s unique identity on the network, and it uses that identity to make the networking system aware of the game object. It offers two different options for configuration and they are mutually exclusive, which means either one of the options or none can be checked.
|
||||
- [NetworkManager](NetworkManager.md)
|
||||
- [Network Manager](NetworkManager.md)
|
||||
The Network Manager is a component for managing the networking aspects of a multiplayer game.
|
||||
- [NetworkManagerHUD](NetworkManagerHUD.md)
|
||||
- [Network Manager HUD](NetworkManagerHUD.md)
|
||||
The Network Manager HUD is a quick-start tool to help you start building your multiplayer game straight away, without first having to build a user interface for game creation/connection/joining. It allows you to jump straight into your gameplay programming, and means you can build your own version of these controls later in your development schedule.
|
||||
[NetworkDiscovery](NetworkDiscovery.md)
|
||||
[Network Discovery](NetworkDiscovery.md)
|
||||
Network Discovery uses a UDP broadcast on the LAN enabling clients to find the running server and connect to it.
|
||||
- [NetworkProximityChecker](NetworkProximityChecker.md)
|
||||
- [Network Proximity Checker](NetworkProximityChecker.md)
|
||||
The Network Proximity Checker component controls the visibility of game objects for network clients, based on proximity to players.
|
||||
- [NetworkRoomManager](NetworkRoomManager.md)
|
||||
- [Network Room Manager](NetworkRoomManager.md)
|
||||
The Network Room Manager is an extension component of Network Manager that provides a basic functional room.
|
||||
- [NetworkRoomPlayer](NetworkRoomPlayer.md)
|
||||
- [Network Room Player](NetworkRoomPlayer.md)
|
||||
The Network Room Player is a component that's required on Player prefabs used in the Room Scene with the Network Room Manager above.
|
||||
- [NetworkStartPosition](NetworkStartPosition.md)
|
||||
- [Network Start Position](NetworkStartPosition.md)
|
||||
Network Start Position is used by the Network Manager when creating player objects. The position and rotation of the Network Start Position are used to place the newly created player object.
|
||||
- [NetworkTransform](NetworkTransform.md)
|
||||
- [Network Transform](NetworkTransform.md)
|
||||
The Network Transform component synchronizes the movement and rotation of game objects across the network. Note that the network Transform component only synchronizes spawned networked game objects.
|
||||
- [NetworkTransformChild](NetworkTransformChild.md)
|
||||
- [Network Transform Child](NetworkTransformChild.md)
|
||||
The Network Transform Child component synchronizes the position and rotation of the child game object of a game object with a Network Transform component.
|
||||
|
||||
## Authenticators
|
||||
@ -31,9 +31,3 @@ These core components are included in Mirror:
|
||||
|
||||
- [Basic Authenticator](Authenticators/Basic.md)
|
||||
Mirror includes a Basic Authenticator in the Mirror / Authenticators folder which just uses a simple username and password.
|
||||
- [PlayFab Authenticator](Authenticators/PlayFab.md)
|
||||
Coming Soon
|
||||
- [Facebook Authenticator](Authenticators/Facebook.md)
|
||||
Coming Soon
|
||||
- [Google Authenticator](Authenticators/Google.md)
|
||||
Coming Soon
|
||||
|
@ -1,28 +1,28 @@
|
||||
- name: Overview
|
||||
href: index.md
|
||||
- name: NetworkAnimator
|
||||
- name: Network Animator
|
||||
href: NetworkAnimator.md
|
||||
- name: NetworkIdentity
|
||||
- name: Network Identity
|
||||
href: NetworkIdentity.md
|
||||
- name: NetworkManager
|
||||
- name: Network Manager
|
||||
href: NetworkManager.md
|
||||
- name: NetworkManagerHUD
|
||||
- name: Network ManagerHUD
|
||||
href: NetworkManagerHUD.md
|
||||
- name: NetworkDiscovery
|
||||
- name: Network Discovery
|
||||
href: NetworkDiscovery.md
|
||||
- name: NetworkProximityChecker
|
||||
- name: Network ProximityChecker
|
||||
href: NetworkProximityChecker.md
|
||||
- name: NetworkSceneChecker
|
||||
- name: Network SceneChecker
|
||||
href: NetworkSceneChecker.md
|
||||
- name: NetworkRoomManager
|
||||
- name: Network RoomManager
|
||||
href: NetworkRoomManager.md
|
||||
- name: NetworkRoomPlayer
|
||||
- name: Network RoomPlayer
|
||||
href: NetworkRoomPlayer.md
|
||||
- name: NetworkStartPosition
|
||||
- name: Network StartPosition
|
||||
href: NetworkStartPosition.md
|
||||
- name: NetworkTransform
|
||||
- name: Network Transform
|
||||
href: NetworkTransform.md
|
||||
- name: NetworkTransformChild
|
||||
- name: Network TransformChild
|
||||
href: NetworkTransformChild.md
|
||||
- name: Authenticators
|
||||
href: Authenticators/toc.yml
|
||||
|
@ -1,13 +1,21 @@
|
||||
# Change Log
|
||||
|
||||
**Mirror is published to the Asset Store at the start of every month, unless some critical issue causes a delay.**
|
||||
|
||||
Mirror uses semantic versioning, and the versions shown here are those that were published to the Asset Store, and occasionally major version bumps happen mid-month between store submissions and are therefore not individually shown here.
|
||||
|
||||
## Version 10.x.x - In Progress
|
||||
- Added: Weaver will now block play mode and builds if there are weaver errors and show them in the console again.
|
||||
- Added: PooledNetworkReader and PooledNetworkWriter, both Disposable.
|
||||
- Added: NetworkReader.ReadMessage<T>.
|
||||
- Added: NetworkDiscovery now handles headless server mode.
|
||||
- Added: SyncVar, Cmd's and Rpc's now support Scriptable Objects via CreateInstance on the receiving side.
|
||||
- Added: [Discord Transport](../Transports/Discord.md)
|
||||
- Fixed: `isClient` now returns true on clients in OnDestroy for networked objects.
|
||||
- Changed: NetworkSceneChecker now works from OnEnable instead of Awake.
|
||||
- Fixed: Host Player race condition for Ready message.
|
||||
- Fixed: NetworkAnimator and NetworkTransform now correctly check for client authority in their respective Command methods.
|
||||
- Fixed: Network Room Manager Script Template had a virtual method instead of an override.
|
||||
- Changed: NetworkSceneChecker now works from OnEnable instead of Awake, and uses Scene instead of scene name.
|
||||
- Changed: Renamed NeworkWriter.Write to WriteMessage for consistency.
|
||||
|
||||
## Version 9.0.2 - 2020-Feb-04
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Getting Started
|
||||
|
||||
This document describes steps to converting a single player game to a multiplayer game, using the new Unity Multiplayer networking system. The process described here is a simplified, higher level version of the actual process for a real game; it doesn’t always work exactly like this, but it provides a basic recipe for the process.
|
||||
This document describes steps to creating a multiplayer game with Mirror. The process described here is a simplified, higher level version of the actual process for a real game; it doesn’t always work exactly like this, but it provides a basic recipe for the process.
|
||||
|
||||
## Video tutorials
|
||||
|
||||
@ -21,7 +21,6 @@ See [Using the NetworkManager](../Components/NetworkManager.md).
|
||||
## Player Prefab
|
||||
- Find the Prefab for the player game object in the game, or create a Prefab from the player game object
|
||||
- Add the NetworkIdentity component to the player Prefab
|
||||
- Check the LocalPlayerAuthority box on the NetworkIdentity
|
||||
- Set the `playerPrefab` in the NetworkManager’s Spawn Info section to the player Prefab
|
||||
- Remove the player game object instance from the Scene if it exists in the Scene
|
||||
|
||||
@ -29,8 +28,9 @@ See [Player Objects](../Guides/GameObjects/SpawnPlayer.md) for more information.
|
||||
|
||||
## Player movement
|
||||
- Add a NetworkTransform component to the player Prefab
|
||||
- Check the Client Authority checkbox on the component.
|
||||
- Update input and control scripts to respect `isLocalPlayer`
|
||||
- Fix Camera to use spawned player and `isLocalPlayer`
|
||||
- Override OnStartLocalPlayer to take control of the Main Camera in the scene for the player.
|
||||
|
||||
For example, this script only processes input for the local player:
|
||||
|
||||
|
@ -1,82 +0,0 @@
|
||||
# Converting a Single-Player Game to Mirror
|
||||
|
||||
This document describes steps to converting a single player game to a multiplayer game, using Mirror. The process described here is a simplified, higher level version of the actual process for a real game; it doesn’t always work exactly like this, but it provides a basic recipe for the process.
|
||||
|
||||
## NetworkManager set-up
|
||||
- Add a new game object and rename it “NetworkManager”.
|
||||
- Add the NetworkManager component to the “NetworkManager” game object.
|
||||
- Add the NetworkManagerHUD component to the game object. This provides the default UI for managing the network game state.
|
||||
|
||||
See Using the NetworkManager.
|
||||
|
||||
## Player Prefab Setup
|
||||
- Find the Prefab for the player game object in the game, or create a Prefab from the player game object
|
||||
- Add the NetworkIdentity component to the player Prefab
|
||||
- Set the `playerPrefab` in the NetworkManager’s Spawn Info section to the player Prefab
|
||||
- Remove the player game object instance from the Scene if it exists in the Scene
|
||||
|
||||
See Player Objects for more information.
|
||||
|
||||
## Player Movement
|
||||
- Add a NetworkTransform component to the player Prefab
|
||||
- Update input and control scripts to respect `isLocalPlayer`
|
||||
- Fix Camera to use spawned player and `isLocalPlayer`
|
||||
|
||||
For example, this script only processes input for the local player:
|
||||
|
||||
```cs
|
||||
using UnityEngine;
|
||||
using Mirror;
|
||||
|
||||
public class Controls : NetworkBehaviour
|
||||
{
|
||||
void Update()
|
||||
{
|
||||
if (!isLocalPlayer)
|
||||
{
|
||||
// exit from update if this is not the local player
|
||||
return;
|
||||
}
|
||||
|
||||
// handle player input for movement
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Player Game State
|
||||
- Make scripts that contain important data into NetworkBehaviours instead of MonoBehaviours
|
||||
- Make important member variables into SyncVars
|
||||
|
||||
See State Synchronization.
|
||||
|
||||
## Networked Actions
|
||||
- Make scripts that perform important actions into NetworkBehaviours instead of MonoBehaviours
|
||||
- Update functions that perform important player actions to be commands
|
||||
|
||||
See Networked Actions.
|
||||
|
||||
## Non-player Game Objects
|
||||
|
||||
Fix non-player prefabs such as enemies:
|
||||
- Add the NetworkIdentify component
|
||||
- Add the NetworkTransform component
|
||||
- Register spawnable Prefabs with the NetworkManager
|
||||
- Update scripts with game state and actions
|
||||
|
||||
## Spawners
|
||||
- Potentially change spawner scripts to be NetworkBehaviours
|
||||
- Modify spawners to only run on the server (use isServer property or the `OnStartServer()` function)
|
||||
- Call `NetworkServer.Spawn()` for created game objects
|
||||
|
||||
## Spawn Positions for Players
|
||||
- Add a new game object and place it at player’s start location
|
||||
- Add the NetworkStartPosition component to the new game object
|
||||
|
||||
## Room
|
||||
- Create Room Scene
|
||||
- Add a new game object to the Scene and rename it to “NetworkRoomManager”.
|
||||
- Add the NetworkRoomManager component to the new game object.
|
||||
- Configure the Manager:
|
||||
- Scenes
|
||||
- Prefabs
|
||||
- Spawners
|
@ -2,11 +2,11 @@
|
||||
|
||||
Multiplayer games use the concept of network visibility to determine which players can see which game objects at any given time during game play. In a game that has a moving viewpoint and moving game objects, it’s common that players cannot see everything that is happening in the game at once.
|
||||
|
||||
If a particular player, at a certain point in time during game play, cannot see most of the other players, non-player characters, or other moving or interactive things in your game, there is usually no need for the host to send information about those things to the player’s client.
|
||||
If a particular player, at a certain point in time during game play, cannot see most of the other players, non-player characters, or other moving or interactive things in your game, there is usually no need for the server to send information about those things to the player’s client.
|
||||
|
||||
This can benefit your game in two ways:
|
||||
- It reduces the amount of data sent across the network between players. This can help improve the responsiveness of your game, and reduce bandwidth use. The bigger and more complex your multiplayer game, the more important this issue is.
|
||||
- It also helps prevent hacking. Since a player client does not have information about things that can’t be seen, a hack on that player’s computer cannot reveal the information.
|
||||
- It also helps prevent some cheating. Since a player client does not have information about things that can’t be seen, a hack on that player’s computer cannot reveal the information.
|
||||
|
||||
The idea of “visibility” in the context of networking doesn’t necessarily relate to whether game objects are directly visible on-screen. Instead, it relates to whether data should or shouldn’t be sent about the game object in question to a particular client. Put simply, if a client can’t ‘see’ an game object, it does not need to be sent information about that game object across the network. Ideally you want to limit the amount of data you are sending across the network to only what is necessary, because sending large amounts of unnecessary data across the network can cause network performance problems.
|
||||
|
||||
@ -16,6 +16,10 @@ However, it can be also be resource intensive or complex to determine accurately
|
||||
|
||||
Mirror’s [Network Proximity Checker](../Components/NetworkProximityChecker.md) component is simplest way to implement network visibility for players. It works in conjunction with the physics system to determine whether game objects are close enough (that is, “visible” for the purposes of sending network messages in your multiplayer game).
|
||||
|
||||
## Network Scene Checker Component
|
||||
|
||||
Mirror's [Network Scene Checker](../Components/NetworkSceneChecker.md) component can be used to isolate players and networked objects on the server in additive scene instances.
|
||||
|
||||
## Network Visibility on Remote Clients
|
||||
|
||||
When a player on a remote client joins a networked game, only game objects that are network-visible to the player will be spawned on that remote client. This means that even if the player enters a large world with many networked game objects, the game can start quickly because it does not need to spawn every game object that exists in the world. Note that this applies to networked game objects in your Scene, but does not affect the loading of Assets. Unity still takes time to load the Assets for registered Prefabs and Scene game objects.
|
||||
@ -29,3 +33,39 @@ The host shares the same Scene as the server, because it acts as both the server
|
||||
Instead, there is the virtual method OnSetLocalVisibility on the NetworkBehaviour class that is invoked. This method is invoked on all `NetworkBehaviour` scripts on game objects that change visibility state on the host.
|
||||
|
||||
The default implementation of `OnSetLocalVisibility` disables or enables all renderer components on the game object. If you want to customize this implementation, you can override the method in your script, and provide a new behavior for how the host (and therefore the local client) should respond when a game object becomes network-visible or invisible (such as disabling HUD elements or renderers).
|
||||
|
||||
## Customizing Network Visibility
|
||||
|
||||
Sometimes you might want to use other kinds of visibility check, such as grid-based rules, line-of-sight tests, navigation path tests, or any other type of test that suits your game.
|
||||
|
||||
To do this, you can create your own custom Network Observer from a [script template](../General/ScriptTemplates.md) via the Assets menu by clicking Create -> Mirror -> Network Observer.
|
||||
|
||||
It may be helpful to understand how the Network Proximity Checker works.
|
||||
|
||||
The Network Proximity Checker is implemented using the public visibility interface of Mirror’s HLAPI. Using this same interface, you can implement any kind of visibility rules you desire. Each `NetworkIdentity` keeps track of the set of players that it is visible to. The players that a NetworkIdentity game object is visible to are called the “observers” of the NetworkIdentity.
|
||||
|
||||
The Network Proximity Checker calls the `RebuildObservers` method on the Network Identity component at a fixed interval (set using the “Vis Update Interval” value in the inspector), so that the set of network-visible game objects for each player is updated as they move around.
|
||||
|
||||
On the `NetworkBehaviour`class (which your networked scripts inherit from), there are some virtual functions for determining visibility. These are:
|
||||
- **OnCheckObserver**
|
||||
This method is called on the server, on each networked game object when a new player enters the game. If it returns true, that player is added to the object’s observers. The Network Proximity Checker does a simple distance check in its implementation of this function, and uses `Physics.OverlapSphereNonAlloc` to find the players that are within the visibility distance for this object.
|
||||
- **OnRebuildObservers**
|
||||
This method is called on the server when `RebuildObservers` is invoked. This method expects the set of observers to be populated with the players that can see the object. The NetworkServer then handles sending `ObjectHide` and `ObjectSpawn` messages based on the differences between the old and new visibility sets.
|
||||
- **OnSetHostVisibility**
|
||||
This method is called on the server by the visibility system for objects on a host. Objects on a host (with a local client) cannot be disabled or destroyed when they are not visibile to the local client. So this function is called to allow custom code to hide these objects. A typical implementation will disable renderer components on the object. This is only called on local clients on a host.
|
||||
|
||||
You can check whether any given networked game object is a player by checking if its `NetworkIdentity` has a valid connectionToClient. For example:
|
||||
|
||||
``` cs
|
||||
int hitCount = Physics.OverlapSphereNonAlloc(transform.position, visRange, hitsBuffer3D, castLayers);
|
||||
|
||||
for (int i = 0; i < hitCount; i++)
|
||||
{
|
||||
Collider hit = hitsBuffer3D[i];
|
||||
|
||||
NetworkIdentity identity = hit.GetComponent<NetworkIdentity>();
|
||||
|
||||
if (identity != null && identity.connectionToClient != null)
|
||||
observers.Add(identity.connectionToClient);
|
||||
}
|
||||
```
|
||||
|
@ -1,31 +0,0 @@
|
||||
# Customizing Network Visibility
|
||||
|
||||
The built-in [Network Proximity Checker](../Components/NetworkProximityChecker.md) component is the built-in default component for determining a game object’s network visibility. However, this only provides you with a distance-based check. Sometimes you might want to use other kinds of visibility check, such as grid-based rules, line-of-sight tests, navigation path tests, or any other type of test that suits your game.
|
||||
|
||||
To do this, you can implement your own custom equivalent of the Network Proximity Checker. To do that, you need to understand how the Network Proximity Checker works. See documentation on the Network Proximity Checker component.
|
||||
|
||||
The Network Proximity Checker is implemented using the public visibility interface of Mirror’s HLAPI. Using this same interface, you can implement any kind of visibility rules you desire. Each `NetworkIdentity` keeps track of the set of players that it is visible to. The players that a NetworkIdentity game object is visible to are called the “observers” of the NetworkIdentity.
|
||||
|
||||
The Network Proximity Checker calls the `RebuildObservers` method on the Network Identity component at a fixed interval (set using the “Vis Update Interval” value in the inspector), so that the set of network-visible game objects for each player is updated as they move around.
|
||||
|
||||
On the `NetworkBehaviour`class (which your networked scripts inherit from), there are some virtual functions for determining visibility. These are:
|
||||
- **OnCheckObserver**
|
||||
This method is called on the server, on each networked game object when a new player enters the game. If it returns true, that player is added to the object’s observers. The Network Proximity Checker does a simple distance check in its implementation of this function, and uses `Physics.OverlapSphereNonAlloc` to find the players that are within the visibility distance for this object.
|
||||
- **OnRebuildObservers**
|
||||
This method is called on the server when `RebuildObservers` is invoked. This method expects the set of observers to be populated with the players that can see the object. The NetworkServer then handles sending `ObjectHide` and `ObjectSpawn` messages based on the differences between the old and new visibility sets.
|
||||
|
||||
You can check whether any given networked game object is a player by checking if its `NetworkIdentity` has a valid connectionToClient. For example:
|
||||
|
||||
``` cs
|
||||
int hitCount = Physics.OverlapSphereNonAlloc(transform.position, visRange, hitsBuffer3D, castLayers);
|
||||
|
||||
for (int i = 0; i < hitCount; i++)
|
||||
{
|
||||
Collider hit = hitsBuffer3D[i];
|
||||
|
||||
NetworkIdentity identity = hit.GetComponent<NetworkIdentity>();
|
||||
|
||||
if (identity != null && identity.connectionToClient != null)
|
||||
observers.Add(identity.connectionToClient);
|
||||
}
|
||||
```
|
@ -8,22 +8,20 @@
|
||||
href: Authentication.md
|
||||
- name: Network Discovery
|
||||
href: NetworkDiscovery.md
|
||||
- name: Conversion
|
||||
href: Conversion.md
|
||||
- name: Player Movement
|
||||
href: CheatSafeLocalPlayerMovement.md
|
||||
- name: Network Profiler
|
||||
href: Profiler.md
|
||||
- name: Attributes
|
||||
href: Attributes.md
|
||||
- name: NetworkBehaviour
|
||||
href: NetworkBehaviour.md
|
||||
- name: Network Behaviour
|
||||
href: Network Behaviour.md
|
||||
- name: Clock Synchronization
|
||||
href: ClockSync.md
|
||||
- name: Data Types
|
||||
href: DataTypes.md
|
||||
- name: Visibility
|
||||
href: Visibility.md
|
||||
- name: Custom Visibility
|
||||
href: VisibilityCustom.md
|
||||
- name: Development Servers
|
||||
href: DevServer/toc.yml
|
||||
topicHref: DevServer/
|
||||
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
@ -1,8 +1,8 @@
|
||||
# Discord-Mirror
|
||||
# Discord Transport
|
||||
|
||||
Discord-Mirror is a networking transport that enables sending networking packets via [Discord's Game SDK](https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide).
|
||||
Discord Transport is a networking transport that enables sending networking packets via [Discord's Game SDK](https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide).
|
||||
|
||||
![The Discord-Mirror Transport](DiscordMirror.PNG)
|
||||
![The Discord Transport](Discord.PNG)
|
||||
|
||||
[Latest Release](https://github.com/Derek-R-S/Discord-Mirror/releases)
|
||||
|
@ -12,7 +12,7 @@ Mirror is a high level Networking Library that can use several different low lev
|
||||
|
||||
- [Fallback](Fallback.md) Fallback is a compatibility transport for transports that don't run on all platforms and need fallback options to cover all other platforms.
|
||||
|
||||
- [Discord](DiscordMirror.md) Discord-Mirror is a networking transport that enables sending networking packets via [Discord's Game SDK](https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide).
|
||||
- [Discord](Discord.md) Discord Transport is a networking transport that enables sending networking packets via [Discord's Game SDK](https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide).
|
||||
|
||||
- [UDP - Ignorance](Ignorance.md) Ignorance implements a reliable and unreliable sequenced UDP transport based on ENet.
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
- name: Fallback
|
||||
href: Fallback.md
|
||||
- name: Discord
|
||||
href: DiscordMirror.md
|
||||
href: Discord.md
|
||||
- name: UDP - Ignorance
|
||||
href: Ignorance.md
|
||||
- name: UDP - LiteNetLib4Mirror
|
||||
|
11
doc/index.md
11
doc/index.md
@ -28,17 +28,16 @@ We've developed a [List Server](https://mirror-networking.com/list-server/) wher
|
||||
- Additive Scene Loading
|
||||
- Single and separated Unity projects supported
|
||||
- Network [Authenticators](Guides/Authentication.md) to protect your game
|
||||
- Network [Discovery](Guides/NetworkDiscovery.md) to easily connect LAN players to a LAN Host
|
||||
- Network [Manager](Components/NetworkManager.md) and [HUD](Components/NetworkManagerHUD.md)
|
||||
- Network [Room Manager](Components/NetworkRoomManager.md) and [Room Player](Components/NetworkRoomPlayer.md)
|
||||
- Network [Identity](Components/NetworkIdentity.md)
|
||||
- Network [Transform](Components/NetworkTransform.md)
|
||||
- Network [Transform](Components/NetworkTransform.md) to sync position, rotation, and scale with interpolation
|
||||
- Network [Animator](Components/NetworkAnimator.md) with 64 parameters
|
||||
- Network [Proximity Checker](Components/NetworkProximityChecker.md)
|
||||
- Network [Proximity Checker](Components/NetworkProximityChecker.md) to help with Area of Interest
|
||||
- Network [Scene Checker](Components/NetworkSceneChecker.md) to islolate players and networked objects to Additive scene instances
|
||||
- [SyncVar](Guides/Sync/SyncVars.md), [SyncList](Guides/Sync/SyncLists.md), [SyncEvent](Guides/Sync/SyncEvent.md), [SyncDictionary](Guides/Sync/SyncDictionary.md), and [SyncHashSet](Guides/Sync/SyncHashSet.md)
|
||||
|
||||
**Guides**
|
||||
- [Cheat safe, local player movement beyond NetworkTransform](Guides/CheatSafeLocalPlayerMovement.md)
|
||||
|
||||
**Integrations**
|
||||
- [Dissonance Voice Chat](https://assetstore.unity.com/packages/tools/audio/dissonance-voice-chat-70078)
|
||||
- [Network Sync Transform](https://github.com/emotitron/NetworkSyncTransform)
|
||||
@ -47,3 +46,5 @@ We've developed a [List Server](https://mirror-networking.com/list-server/) wher
|
||||
- [RTS Engine](https://assetstore.unity.com/packages/templates/packs/rts-engine-79732)
|
||||
- [Smooth Sync](https://assetstore.unity.com/packages/tools/network/smooth-sync-96925)
|
||||
- [Weather Maker](https://assetstore.unity.com/packages/tools/particles-effects/weather-maker-unity-weather-system-sky-water-volumetric-clouds-a-60955)
|
||||
- [Steamworks Networking](https://assetstore.unity.com/packages/tools/integration/steamworks-networking-151300)
|
||||
- [Master Audio Multiplayer](https://assetstore.unity.com/packages/tools/audio/master-audio-multiplayer-69547)
|
||||
|
Loading…
Reference in New Issue
Block a user