ParagonNetworkBehaviour
Abstract base class for all Paragon network-aware MonoBehaviours. Extends Unity Netcode's NetworkBehaviour with Paragon conventions: static ClientID access, a reference to the Paragon NetworkManager, and integration with the Paragon debug system via IDebugObject.
Definition
Namespace: Paragon.Core.Network Assembly: Paragon.dll
[Serializable]
public abstract class ParagonNetworkBehaviour : NetworkBehaviour, IDebugObjectInheritance: NetworkBehaviour → ParagonNetworkBehaviour Implements: IDebugObject
Remarks
This class serves the same role for networked code that ParagonBehaviour serves for non-networked code — it provides a consistent base class with debug tooling and convenient accessors. All game-specific network behaviours should inherit from this class (or from SingletonNetworkBehaviour<T>).
The class integrates with Paragon's debug system by implementing IDebugObject:
On
OnEnable(), the object registers itself withDebug.Register().On
OnDisable(), the object unregisters withDebug.Unregister().The virtual
OnDebug()method can be overridden to render custom debug information (e.g., Gizmos, GUI).
The NetworkManager property shadows the inherited NetworkBehaviour.NetworkManager to return the Paragon NetworkManager singleton instead of Unity's.
Quick Lookup
Get local client ID
ClientID (static)
Access NetworkManager
this.NetworkManager (returns Paragon's singleton)
Enable debug for this object
debugEnabled = true (Inspector toggle)
Add custom debug rendering
Override OnDebug()
Properties
ClientID (static)
The local client's network ID. Shortcut to NetworkManager.ClientId.
NetworkManager
The Paragon NetworkManager singleton. Shadows the base class property.
DebugEnabled
Whether debug output is enabled for this specific instance. Controlled via a hidden [SerializeField] in the Inspector.
Methods
OnDebug (virtual)
Called by the Paragon debug system when debug rendering is active. Override to draw Gizmos, log state, or render debug GUI.
Extension Points
Optional Overrides
OnEnable()
Registers with debug system. Call base.OnEnable() if overriding.
OnDisable()
Unregisters from debug system. Call base.OnDisable() if overriding.
OnDebug()
Render custom debug visuals when DebugEnabled is true.
Implementation Requirements
When subclassing ParagonNetworkBehaviour, you MUST:
Call
base.OnEnable()if overridingOnEnable()(to maintain debug registration)Call
base.OnDisable()if overridingOnDisable()(to maintain debug unregistration)
You SHOULD:
Use
ClientIDfor local client checks instead of accessing Netcode APIs directlyUse
this.NetworkManagerfor Paragon-level network operationsOverride
OnDebug()for development-time debug visualization
Common Pitfalls
Forgetting base.OnEnable() / base.OnDisable() If you override OnEnable() or OnDisable() without calling base, the object will not register/unregister with the Paragon debug system, causing missing debug output or memory leaks.
NetworkManager property shadowing this.NetworkManager returns the Paragon NetworkManager, not Unity's Unity.Netcode.NetworkManager. If you need the underlying Netcode manager, use NetworkManager.API.
Examples
Basic Network Behaviour
See Also
SingletonNetworkBehaviour — singleton variant of this base class
NetworkManager — the manager this class references
Last updated