Adapters
Abstraction layer for pluggable multiplayer service backends in the Network system. Defines the IServiceAdapter interface that all service implementations must satisfy, enabling the network system to support multiple providers (Unity Gaming Services, Steam, Epic) behind a single API.
Architecture
Data Flow
Key Concepts
IServiceAdapter
Interface defining the contract for all multiplayer service backends — initialize, authenticate, and manage sessions
NetworkServiceType
Enum identifying the active service provider (UNITY, STEAM, EPIC)
UnityServiceAdapter
Concrete adapter implementing IServiceAdapter using Unity Gaming Services (Authentication + Multiplayer)
UnityNetworkSession
Concrete NetworkSession wrapping Unity's ISession with leave, kick, and refresh capabilities
UnityThreadUtils
Internal utility that captures Unity's main thread context via reflection, required before UnityServices.InitializeAsync()
Extension Pattern
To add a new service backend (e.g., Steam):
Create a class implementing
IServiceAdapterSet
ServiceTypeto the correspondingNetworkServiceTypeenum valueImplement all async methods using the platform's SDK
Create a concrete
NetworkSessionsubclass for the platform's session typeRegister the adapter in
NetworkServicefor the newNetworkServiceType
Classes
Interface defining the multiplayer service backend contract
Unity Gaming Services implementation of IServiceAdapter
NetworkSession implementation wrapping Unity's ISession
Reflection-based utility for capturing Unity's main thread context
See Also
Network — system overview
NetworkManager — singleton entry point that delegates to
NetworkServiceUnity Adapters — Unity Gaming Services adapter details
Last updated