Unity

Interface wrappers that mirror Unity's core object hierarchy (Object, Component, Behaviour, MonoBehaviour, ScriptableObject). These interfaces allow Paragon systems to reference Unity types through contracts rather than concrete classes, enabling interface-based programming, mocking, and composition patterns that Unity's sealed class hierarchy does not support natively.

Architecture

spinner

Data Flow

spinner

Interface Hierarchy

Interface
Mirrors
Extends
Purpose

UnityEngine.Object

Identity, naming, and equality for any Unity object

Component

IUnityObject

Transform, GameObject, component queries, and messaging

Behaviour

IComponent

Enable/disable toggling and active state

MonoBehaviour

IBehaviour

Coroutines, invocation, lifecycle flags

ScriptableObject

IUnityObject

Marker for ScriptableObject-based types

Design Purpose

Unity's MonoBehaviour, Component, Behaviour, and ScriptableObject are concrete classes — you cannot define interfaces that they "implement" after the fact. These Paragon interfaces solve this by:

  1. Enabling interface-based contracts — Paragon systems like IParagonBehaviour and IScriptableFactory extend these interfaces instead of requiring concrete Unity types.

  2. Supporting composition — Code can depend on IComponent or IBehaviour rather than a specific MonoBehaviour subclass, enabling more flexible architecture.

  3. Bridging the hierarchy splitIUnityObject is the common root for both IComponent → IBehaviour → IMonoBehaviour (scene objects) and IScriptableObject (asset objects), which mirrors Unity's own inheritance from UnityEngine.Object.

circle-info

Any class inheriting from MonoBehaviour (including ParagonBehaviour) automatically satisfies IMonoBehaviour, IBehaviour, IComponent, and IUnityObject because these interfaces mirror the members that Unity classes already have.

Key Consumers

Consumer
Uses Interface
Why

IMonoBehaviour

Paragon behaviours are MonoBehaviours — extends the interface chain

IScriptableObject

Factories are ScriptableObjects — extends the interface chain

IScriptableFactoryIScriptableObject

Network factories inherit through the ScriptableObject branch

IComponent (via ParagonBehaviour)

Factory-managed scene objects need transform, gameObject

Interfaces

Interface
Description

Root interface — identity, naming, equality

Component access, transform, messaging

Enable/disable and active state

Coroutines, invoke, lifecycle flags

Marker for ScriptableObject types

See Also

Last updated