IParagonBehaviour

Core interface for all Paragon framework MonoBehaviours. Extends Unity's IMonoBehaviour with subsystem access and IDebugObject with debug toggling. This is the base contract that all Paragon behaviours implement, providing a uniform API for subsystem queries and debug infrastructure.

Definition

Namespace: Paragon Assembly: Paragon.dll

public interface IParagonBehaviour : IMonoBehaviour, IDebugObject

Extends:

  • IMonoBehaviour — Unity MonoBehaviour interface (coroutines, invoke, lifecycle)

  • IDebugObject — Debug infrastructure (DebugEnabled, OnDebug())

Remarks

IParagonBehaviour sits at the root of the Paragon object model. Every concrete Paragon MonoBehaviour (via ParagonBehaviour) implements this interface, which provides two capabilities:

  1. Subsystem access — The Subsystem property exposes the behaviour's optional ParagonSubsystem container, which holds modular IParagonComponent instances. The HasSubsystem property allows null-checking without accessing the subsystem directly.

  2. Debug infrastructure — Inherited from IDebugObject, providing a DebugEnabled toggle and OnDebug() callback used by the Paragon debug system.

Subsystem Ownership

The subsystem is optional — not all behaviours need modular components. HasSubsystem returns false when no subsystem has been created. Behaviours that use the component system should also implement IParagonSubsystem<TBehaviour> for type-safe access.

Quick Lookup

Goal
How

Check if behaviour has a subsystem

behaviour.HasSubsystem

Access the subsystem

behaviour.Subsystem

Check if debug is enabled

behaviour.DebugEnabled

Type-safe subsystem access

Cast to IParagonSubsystem<T> or use extension methods

Properties

Subsystem

The behaviour's ParagonSubsystem container, or null if none has been created.

HasSubsystem

Returns true if the behaviour has an initialized subsystem.

Implementation Requirements

When implementing IParagonBehaviour, you MUST:

  1. Satisfy all IMonoBehaviour requirements (Unity MonoBehaviour members)

  2. Satisfy all IDebugObject requirements (DebugEnabled, OnDebug())

  3. Provide a Subsystem property (may return null if the behaviour does not use components)

circle-info

In practice, always subclass ParagonBehaviour rather than implementing this interface directly. It provides the serialized subsystem field, debug registration, and Odin serialization support.

See Also

Last updated