新增FishNet文档
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
# SpawnablePrefabs
|
||||
|
||||
Fish-Networking uses a collection of prefabs to manage spawning of network objects across the network. Whenever you instantiate and [spawn](../../../guides/features/networked-gameobjects-and-scripts/spawning/) an object on the server, FishNet will use the selected **Spawnable Prefabs** collection to find which object it is and to automatically instantiate and link the objects on all clients.
|
||||
|
||||
The **Spawnable Prefabs** collection can be set on your [NetworkManager](../../components/managers/network-manager.md) component.
|
||||
|
||||
{% hint style="success" %}
|
||||
The NetworkManager will automatically set the **Spawnable Prefabs** to an automatically managed [DefaultPrefabObjects ](defaultprefabobjects.md)asset if a custom one is not selected.
|
||||
{% endhint %}
|
||||
|
||||
<figure><img src="../../../.gitbook/assets/network-manager-spawnable-prefabs.png" alt="NetworkManager component highlighting Spawnable Prefabs field"><figcaption><p>The <strong>Spawnable Prefabs</strong> field on the NetworkManager</p></figcaption></figure>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
# DefaultPrefabObjects
|
||||
|
||||
The **Default Prefab Objects** asset is a dynamically populated collection of spawnable network objects. FishNet automatically generates it in the designated directory specified in your Fish-Networking configuration, filling it with networked prefabs from the configured locations.
|
||||
|
||||
{% hint style="info" %}
|
||||
You do not need to manually populate or update this collection, FishNet will take care of it automatically.
|
||||
{% endhint %}
|
||||
|
||||
<figure><img src="../../../.gitbook/assets/default-prefab-objects.png" alt=""><figcaption><p>Example of <strong>DefaultPrefabObjects</strong> being populated by Networked Prefabs</p></figcaption></figure>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
# DualPrefabObjects
|
||||
|
||||
The Dual Prefab Objects asset can be used to have Fish-Networking spawn a different prefab on the clients as it uses on the server. Whenever you spawn the server selected version, FishNet will spawn the client version on all clients.
|
||||
|
||||
{% hint style="success" %}
|
||||
You can select the same prefab in both the Server and Client fields to have the same one spawned on all clients as the server.
|
||||
{% endhint %}
|
||||
|
||||
<figure><img src="../../../.gitbook/assets/dual-prefab-objects.png" alt=""><figcaption><p>Example of a <strong>Dual Prefab Objects</strong> asset being populated</p></figcaption></figure>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
# SinglePrefabObjects
|
||||
|
||||
The **Single Prefab Objects** is a scriptable object which you can inherit from for custom functionality. It is used by the DefaultPrefabObjects collection and can also be directly used for your own collections. If using it directly, remember to manually add all your spawnable network object prefabs into its collection.
|
||||
|
||||
<figure><img src="../../../.gitbook/assets/single-spawnable-prefabs.png" alt="screenshot of a single prefab objects asset being filled in"><figcaption><p>A <strong>single prefab objects</strong> asset being manually populated</p></figcaption></figure>
|
||||
Reference in New Issue
Block a user