Mirror/doc/Components/NetworkSceneChecker.md
MrGadget 71c0d3b2ee
feat: Network Scene Checker Component (#1271)
* Create Network Scene Checker Component

* Move objects to subscene in client

* Remove OnStartClient

* Rewritten with static dictionary

* Updated doc

* renamed image

* Replaced image

* fixed image name

* Changed to short-circuit return in Update

* Changed to using string for key since additive scenes may be unloaded

* Added null check

* Removed commented line

* Update Assets/Mirror/Components/NetworkSceneChecker.cs

Co-Authored-By: vis2k <info@noobtuts.com>

* Moved initializer to declaration

* Removed [Scene, SerializeField]

Co-authored-by: vis2k <info@noobtuts.com>
2020-01-25 15:48:47 -05:00

17 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# NetworkSceneChecker
The Network Scene Checker component controls the visibility of game objects for network clients, based on which scene they're in.
![Network Scene Checker component](NetworkSceneChecker.png)
- **Force Hidden**
Tick this checkbox to hide this object from all players.
With the Network Scene Checker, a game running on a client doesnt have information about game objects that are not visible. This has two main benefits: it reduces the amount of data sent across the network, and it makes your game more secure against hacking.
This component would typically be used when the server has several subscenes loaded and needs to isolate networked objects to the subscene they're in.
A game object with a Network Scene Checker component must also have a Network Identity component. When you create a Network Scene Checker component on a game object, Mirror also creates a Network Identity component on that game object if it does not already have one.
Scene objects with a Network Scene Checker component are disabled when they're not in the same scene, and spawned objects are destroyed when they're not in the same scene.