Skip to content

Commit 741b42b

Browse files
docs (update,, refactor. and fix)
Adjusting the component section from a file and folder context. Adjusting the component section for the table of contents. Adding foundational components and helpers sub-sections to network components section. Moved foundational components into the foundational (components) folder and updated links and image paths. Adding AttachableBehaviour document along with images. Added some place holders for AttachableNode and ComponentController. Fixing some invalid image paths.
1 parent 9b4bf43 commit 741b42b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+311
-99
lines changed

com.unity.netcode.gameobjects/Documentation~/TableOfContents.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@
1818
* [Max players](basics/maxnumberplayers.md)
1919
* [Transports](advanced-topics/transports.md)
2020
* [Relay](relay/relay.md)
21-
* [Network components](network-components.md)
22-
* [NetworkObject](basics/networkobject.md)
23-
* [PlayerObjects and player prefabs](basics/playerobjects.md)
24-
* [NetworkObject parenting](advanced-topics/networkobject-parenting.md)
25-
* [NetworkBehaviour](networkbehaviour-landing.md)
26-
* [NetworkBehaviour](basics/networkbehaviour.md)
27-
* [Synchronize](basics/networkbehaviour-synchronize.md)
28-
* [Physics](advanced-topics/physics.md)
29-
* [NetworkManager](components/networkmanager.md)
30-
* [NetworkTransform](components/networktransform.md)
31-
* [NetworkAnimator](components/networkanimator.md)
21+
* [Network components](network-components.md)
22+
* [Foundational Components](components/foundational/foundationalcomponents.md)
23+
* [NetworkObject](components/foundational/networkobject.md)
24+
* [NetworkObject parenting](advanced-topics/networkobject-parenting.md)
25+
* [NetworkBehaviour](components/foundational/networkbehaviour.md)
26+
* [Synchronizing & Order of Operations](components/foundational/networkbehaviour-synchronize.md)
27+
* [NetworkManager](components/foundational/networkmanager.md)
28+
* [PlayerObjects and player prefabs](components/foundational/playerobjects.md)
29+
* [Helper Components](components/Helpers/helpercomponents.md)
30+
* [AttachableBehaviour](components/Helpers/attachablebehaviour.md)
31+
* AttachableNode
32+
* ComponentController
33+
* [NetworkAnimator](components/helpers/networkanimator.md)
34+
* [NetworkTransform](components/helpers/networktransform.md)
35+
* [Physics](advanced-topics/physics.md)
3236
* [Ownership and authority](ownership-authority.md)
3337
* [Understanding ownership and authority](basics/ownership.md)
3438
* [Ownership race conditions](basics/race-conditions.md)

com.unity.netcode.gameobjects/Documentation~/advanced-topics/physics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Some collision events aren't fired when using `NetworkRigidbody`.
2121

2222
## NetworkRigidbody and ClientNetworkTransform
2323

24-
You can use NetworkRigidbody with the [`ClientNetworkTransform`](../components/networktransform.md) package sample to allow the owner client of a NetworkObject to move it authoritatively. In this mode, collisions only result in realistic dynamic collisions if the object is colliding with other NetworkObjects (owned by the same client).
24+
You can use NetworkRigidbody with the [`ClientNetworkTransform`](../components/helpers/networktransform.md) package sample to allow the owner client of a NetworkObject to move it authoritatively. In this mode, collisions only result in realistic dynamic collisions if the object is colliding with other NetworkObjects (owned by the same client).
2525

2626
> [!NOTE]
2727
> Add the ClientNetworkTransform component to your GameObject first. Otherwise the NetworkRigidbody automatically adds a regular NetworkTransform.

com.unity.netcode.gameobjects/Documentation~/advanced-topics/session-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can also decide to clear all data when a session completes or add a timeout
1919

2020
# Reconnection
2121

22-
The best way to reconnect players depends on your game. For example, if you use a [Player Object](../basics/networkobject.md#player-objects), a new `Default Player Prefab` automatically spawns when a player connects to the game (including when they reconnect). You can use the player's earlier saved session data to update that object so that it returns to the same state before disconnecting. In those cases, you would need to keep all the important data that you want to restore and map it to the player using your identification system. You can save this data when a player disconnects or update it periodically. You can then use the `OnNetworkSpawn` event on the Player Object's `NetworkBehavior`(s) to get this data and apply it where needed.
22+
The best way to reconnect players depends on your game. For example, if you use a [Player Object](../components/foundational/networkobject.md#player-objects), a new `Default Player Prefab` automatically spawns when a player connects to the game (including when they reconnect). You can use the player's earlier saved session data to update that object so that it returns to the same state before disconnecting. In those cases, you would need to keep all the important data that you want to restore and map it to the player using your identification system. You can save this data when a player disconnects or update it periodically. You can then use the `OnNetworkSpawn` event on the Player Object's `NetworkBehavior`(s) to get this data and apply it where needed.
2323

2424
In cases where we don't use the Player Object approach and instead manually attribute client ownership to `NetworkObject`(s), we can keep the objects that a player owns when they disconnect, and set the reconnected player as their new owner. To accomplish this, the only data we would need to keep would be the mapping between those objects and their owning player's identifier, then when a player reconnects we can use this mapping to set them as the new owner. This mapping can be as simple as a dictionary mapping the player identifier with the `NetworkObjectId`(s) of the `NetworkObject`(s) they own. Then, in the `OnClientConnectedCallback` from the `NetworkManager`, the server can set the ownership of these objects.
2525

com.unity.netcode.gameobjects/Documentation~/basics/object-spawning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ _In most cases, you will want to keep the `NetworkObject` component attached to
3131

3232
By default a newly spawned network Prefab instance is owned by the server unless otherwise specified.
3333

34-
See [Ownership](networkobject.md#ownership) for more information.
34+
See [Ownership](../components/foundational/networkobject.md#ownership) for more information.
3535

3636
The following is a basic example of how to spawn a network Prefab instance (with the default server ownership):
3737

com.unity.netcode.gameobjects/Documentation~/basics/object-visibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ NetworkObject.SpawnWithObservers = false;
111111
NetworkObject.Spawn();
112112
```
113113

114-
See [Spawning With (or Without) Observers](networkobject.md#spawning-with-or-without-observers) for more information.
114+
See [Spawning With (or Without) Observers](../components/foundational/networkobject.md#spawning-with-or-without-observers) for more information.

com.unity.netcode.gameobjects/Documentation~/basics/ownership.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Understanding ownership and authority
22

3-
By default, Netcode for GameObjects assumes a [client-server topology](../terms-concepts/client-server.md), in which the server owns all NetworkObjects (with [some exceptions](networkobject.md#ownership)) and has ultimate authority over [spawning and despawning](object-spawning.md).
3+
By default, Netcode for GameObjects assumes a [client-server topology](../terms-concepts/client-server.md), in which the server owns all NetworkObjects (with [some exceptions](../components/foundational/networkobject.md#ownership)) and has ultimate authority over [spawning and despawning](object-spawning.md).
44

55
Netcode for GameObjects also supports building games with a [distributed authority topology](../terms-concepts/distributed-authority.md), which provides more options for ownership and authority over NetworkObjects.
66

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 `NetworkObject`s 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](../../basics/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/foundational/networkbehaviour.md#pre-spawn-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~/basics/scenemanagement/inscene-placed-networkobjects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ In-scene placed `NetworkObject`s are GameObjects with a `NetworkObject` componen
1313
- For example, a heads up display (HUD) that includes information about other items or players.
1414
- Or some form of platform or teleporter that moves a player from one location to the next when a player enters a trigger or uses an object.
1515

16-
Another benefit of in-scene placed `NetworkObject`s is that they don't require you to register them with the [`NetworkManager`](../../components/networkmanager.md). In-scene placed `NetworkObjects` are registered internally, when scene management is enabled, for tracking and identification purposes.
16+
Another benefit of in-scene placed `NetworkObject`s is that they don't require you to register them with the [`NetworkManager`](../../components/foundational/networkmanager.md). In-scene placed `NetworkObjects` are registered internally, when scene management is enabled, for tracking and identification purposes.
1717

1818
> [!NOTE]
1919
> Items that can be picked up are typically better implemented using a [hybrid approach](#hybrid-approach) with both an in-scene placed and a dynamically spawned `NetworkObject`. The in-scene placed `NetworkObject` can be used to configure additional information about the item (what kind, does another one respawn after one is picked up, and if so how much time should it wait before spawning a new item), while the dynamically spawned object is the item itself.

com.unity.netcode.gameobjects/Documentation~/basics/scenemanagement/scene-events.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ While client synchronization does fall partially outside of the scene management
5757
<br/>
5858
Below is a diagram of the client connection approval and synchronization process:
5959

60-
![image](../images/scenemanagement_synchronization_overview.png)
60+
![image](../../images/scenemanagement_synchronization_overview.png)
6161

6262
Starting with the "Player" in the top right part of the above diagram, the client (Player) runs through the connection and approval process first which occurs within the `NetworkManager`. Once approved, the server-side `NetworkSceneManager` begins the client synchronization process by sending the `SceneEventType.Synchronize` Scene Event message to the approved client. The client then processes through the synchronization message. Once the client is finished processing the synchronize message, it responds to the server with a `SceneEventType.SynchronizeComplete` message. At this point the client is considered "synchronized". If the server determines any `NetworkObject` was despawned during the client-side synchronization message processing period, it will send a list of `NetworkObject` identifiers to the client via the `SceneEventType.ReSynchronize` message and the client will locally despawn the `NetworkObject`s.
6363

@@ -228,10 +228,10 @@ You can stop the coroutine checking the progress upon receiving any of the follo
228228
The SceneEvent class has values that may or may not be set depending upon the `SceneEventType`. Below are two quick lookup tables to determine which property is set for each `SceneEventType`.
229229

230230
**Part-1**<br/>
231-
![image](../images/SceneEventProperties-1.png)<br/>
231+
![image](../../images/SceneEventProperties-1.png)<br/>
232232

233233
**Part-2** <br/>
234-
![image](../images/SceneEventProperties-2.png)<br/>
234+
![image](../../images/SceneEventProperties-2.png)<br/>
235235

236236
So, the big "take-away" from the above table is that you need to understand the `SceneEventType` context of the `SceneEvent` you are processing to know which properties are valid and you can use. As an example, it wouldn't make sense to provide the AsyncOperation for the following `SceneEventType`s:
237237
- LoadComplete or LoadEventCompleted

0 commit comments

Comments
 (0)