Network

The Network system provides a Paragon-level abstraction over Unity Netcode for GameObjects, adding service-based connection management, custom messaging, singleton network behaviours, and player identity. It wraps Unity.Netcode.NetworkManager with a higher-level API for connecting, session management, and network object spawning.

Architecture

spinner

Data Flow

spinner

Key Concepts

Concept
Description

NetworkManager

Singleton entry point for all networking. Wraps Unity's NetworkManager with session, messaging, and prefab handler APIs.

ConnectionData

Value type carrying user identity during connection. Auto-serializes to/from byte[] for Netcode's connection payload.

ParagonNetworkBehaviour

Abstract base for all network-aware MonoBehaviours. Adds debug registration and convenient ClientID access.

SingletonNetworkBehaviour

Generic singleton pattern for network behaviours. Auto-spawns its NetworkObject on Start().

NetworkPlayer

Immutable record linking a NetworkUser (identity) with a NetworkClient (connection).

NetworkObjectExtensions

Extension methods for UnityEngine.Object and NetworkObject to simplify spawning and per-object messaging.

Connection Lifecycle

  1. ConnectNetworkManager.Connect() creates a service adapter and signs in anonymously, producing a NetworkUser.

  2. ConnectionData — The user's identity is serialized into ConnectionData and set as the Netcode connection payload.

  3. SessionQuickStart(), CreateSession(), or JoinSession() establishes a multiplayer session.

  4. SpawningInstantiateAndSpawn<T>() instantiates a prefab and immediately network-spawns it.

  5. DisconnectLeaveSession() exits the session; Disconnect() tears down the transport.

Quick Start

Connecting and Starting a Session

Spawning a Network Object

Per-Object Messaging

Subsystems

Subsystem
Description

Multiplayer session state, player tracking, connection approval, and synchronization

Custom network messaging system

Network-aware scriptable factory integration

Player identity types

Network behaviour base classes

Extension methods for network objects

Custom Inspector tooling for network behaviours

Classes

Class
Description

Singleton entry point for connection, sessions, spawning, and messaging

Serializable struct carrying user identity for connection payloads

Extension methods for NetworkObject spawning and messaging

Abstract base class for all Paragon network behaviours

Generic singleton pattern for network behaviours

Record linking user identity with network client

Abstract base class for multiplayer session management

Read-only struct carrying session metadata

Odin-based custom Inspector for network behaviours

Last updated