Network Manager

Network Prefabs

When you spawn an object over the network, the other side needs to know which prefab to instantiate. The server might say "spawn prefab #7", but if the client doesn't have the same list of prefabs in the same order, it'll spawn the wrong thing or fail entirely. Network Prefabs solve this by giving all machines a shared registry of prefabs that PurrNet can reference by ID.

The Network Prefabs is a scriptable object used by PurrNet to cross identify prefabs. This is used for spawning and despawning of objects.

This is set as a reference on your NetworkManager

The Network Prefabs scriptable having pulled a bunch of project prefabs

Settings of the Network Prefabs scriptable allows you to easily modify from where it pulls the objects. If you have a prefabs folder which you intend to hold all prefabs, it would be optimal to set the folder to that. It will automatically search any sub-folders.

The Folder / Scene field also accepts a scene. The registry then pulls the prefabs that scene references and regenerates when the scene is saved. With auto generate on, the list always mirrors what the scan finds, so prefabs that are no longer referenced are removed. This is the building block for scene scoped prefabs, which load and unload with their scene instead of living on the Network Manager.

Settings can also modify whether it should auto generate to find prefabs or you'd want to handle it manually, and lastly it can also find any non-networked objects and add them as well, so even objects without a network identity script, can be spawned over the network. This will automatically add the PrefabLink script to it.