Skip to content

Commit a8b7743

Browse files
committed
Follow up docs pass
1 parent c1fd85e commit a8b7743

File tree

5 files changed

+60
-65
lines changed

5 files changed

+60
-65
lines changed

com.unity.netcode.gameobjects/Documentation~/basics/scenemanagement/custom-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Once you've registered your in-scene placed Network Prefabs with your `NetworkPr
3939
> When a client first connects, it deletes any in-scene placed `NetworkObjects` in any of the scenes it has currently loaded. When using a custom scene management solution, in-scene placed NetworkObjects are actually dynamically spawned. This means any changes you make to your in-scene placed Network Prefabs will *not* be synchronized with clients automatically.
4040
4141
### Synchronizing In-Scene Placed Network Prefab Instances
42-
If you want to change an in-scene placed network prefab instance, you need to handle the serialization of these settings yourself. You can do this by overriding `NetworkBehaviour.OnSynchronize` and serializing any property updates you want to have synchronized with clients when they join. [Read More About OnSynchronize Here](../../components/core/networkbehaviour.md#pre-spawn-synchronization).
42+
If you want to change an in-scene placed network prefab instance, you need to handle the serialization of these settings yourself. You can do this by overriding `NetworkBehaviour.OnSynchronize` and serializing any property updates you want to have synchronized with clients when they join. [Read More About OnSynchronize Here](../../components/core/networkbehaviour.md#prespawn-synchronization).
4343

4444
## Starting a Netcode Enabled Game Session
4545
The recommended way of starting session using your own scene management solution is to assure that when a client attempts to join a netcode game session it should already have (as best as possible) any scenes that the server might have loaded. While this does not assure that your newly connecting client will load any additional scenes that might have been loaded, using this approach initially will get you started so you can then come up with a strategy to handling:

com.unity.netcode.gameobjects/Documentation~/components/core/corecomponents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Learn about the three core components of Netcode for GameObjects: NetworkObject,
2121
| **Topic** | **Description** |
2222
| :------------------------------ | :------------------------------- |
2323
| **[NetworkBehaviour](networkbehaviour.md)** | [NetworkBehaviour](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest?subfolder=/api/Unity.Netcode.NetworkBehaviour.html) is an abstract class that derives from [MonoBehaviour](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html) and is primarily used to create unique netcode or game logic. To replicate any netcode-aware properties or send and receive RPCs, a [GameObject](https://docs.unity3d.com/Manual/GameObjects.html) must have a [NetworkObject](networkobject.md) component and at least one NetworkBehaviour component. |
24-
| **[Synchronizing](networkbehaviour-synchronize.md)** | Understand a NetworkBehaviour component's order of operations when it comes to spawning, de-spawning, and adding custom synchronization data. |
24+
| **[Synchronizing](networkbehaviour-synchronize.md)** | Understand a NetworkBehaviour component's order of operations when it comes to spawning, despawning, and adding custom synchronization data. |
2525

2626

2727
## NetworkManager

com.unity.netcode.gameobjects/Documentation~/components/core/networkbehaviour-synchronize.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ You can use NetworkBehaviours to synchronize settings before, during, and after
66

77
For more information about spawning and despawning NetworkBehaviours, refer to the [NetworkBehaviour spawning and despawning page](networkbehaviour.md).
88

9-
## Pre-spawn, spawn, post-spawn and synchronization
9+
## Prespawn, spawn, post-spawn and synchronization
1010

1111
The NetworkObject spawn process can become complicated when there are multiple NetworkBehaviour components attached to the same GameObject. Additionally, there can be times where you want to be able to handle pre- and post-spawn oriented tasks.
1212

13-
- Pre-spawn example: Instantiating a `NetworkVariable` with owner write permissions and assigning a value to that `NetworkVariable` on the server or host side.
13+
- Prespawn example: Instantiating a `NetworkVariable` with owner write permissions and assigning a value to that `NetworkVariable` on the server or host side.
1414
- Spawn example: Applying a local value or setting that may be used during post spawn by another local NetworkBehaviour component.
1515
- Post-spawn example: Accessing a `NetworkVariable` or other property that is set during the spawn process.
1616

1717
Below are the three virtual methods you can override within a NetworkBehaviour-derived class:
1818

1919
Method | Scope | Use case | Context
2020
---------------------------- | ------------------------ | ------------------------------------------------------ | -------------
21-
OnNetworkPreSpawn | NetworkObject | Pre-spawn initialization | Client and server
21+
OnNetworkPreSpawn | NetworkObject | Prespawn initialization | Client and server
2222
OnNetworkSpawn | NetworkObject | During spawn initialization | Client and server
2323
OnNetworkPostSpawn | NetworkObject | Post-spawn actions | Client and server
2424
OnNetworkSessionSynchronized | All NetworkObjects | New client finished synchronizing | Client-side only
2525
OnInSceneObjectsSpawned | In-scene NetworkObjects | New client finished synchronizing or a scene is loaded | Client and server
26-
OnNetworkPreDespawn | NetworkObject | Invoked before de-spawning NetworkObject | Client and server
26+
OnNetworkPreDespawn | NetworkObject | Invoked before despawning NetworkObject | Client and server
2727

2828
In addition to the methods above, there are two special case convenience methods:
2929

@@ -33,7 +33,7 @@ In addition to the methods above, there are two special case convenience methods
3333
- A client finishes synchronizing.
3434
- On the server and client side after a scene has been loaded and all newly instantiated in-scene placed NetworkObjects have been spawned.
3535

36-
### Pre-spawn synchronization with `OnSynchronize`
36+
### Prespawn synchronization with `OnSynchronize`
3737

3838
There can be scenarios where you need to include additional configuration data or use a NetworkBehaviour to configure some non-netcode related component (or the like) before a NetworkObject is spawned. This can be particularly critical if you want specific settings applied before `NetworkBehaviour.OnNetworkSpawn` is invoked. When a client is synchronizing with an existing network session, this can become problematic as messaging requires a client to be fully synchronized before you know "it is safe" to send the message, and even if you send a message there is the latency involved in the whole process that might not be convenient and can require additional specialized code to account for this.
3939

0 commit comments

Comments
 (0)