Class BaseConnectionComponent
Abstract base class for MonoBehaviour components that own and manage an IConnector.
Inherited Members
Namespace: Unity.SimulationPro.Foundation
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
public abstract class BaseConnectionComponent : MonoBehaviour
Remarks
Subclasses implement CreateConnector() to supply a concrete IConnector
instance. On Start, the connector is optionally connected and registered with
ConnectorHud. On OnDestroy, it is disconnected and unregistered.
Properties
ConnectOnStart
Gets or sets a value indicating whether Connect() is called automatically in Start.
Declaration
public bool ConnectOnStart { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ShowInHud
Gets or sets a value indicating whether this connector's header is registered with ConnectorHud.
Declaration
public bool ShowInHud { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
CreateConnector()
Creates and returns the IConnector instance managed by this component.
Declaration
protected abstract IConnector CreateConnector()
Returns
| Type | Description |
|---|---|
| IConnector | A new IConnector instance. |
DrawHeaderGUI()
Draws the header GUI content for this connection in the ConnectorHud.
Declaration
protected virtual void DrawHeaderGUI()
GetConnector()
Gets the IConnector managed by this component, creating it on first access.
Declaration
public IConnector GetConnector()
Returns
| Type | Description |
|---|---|
| IConnector | The connector instance for this component. |
OnDestroy()
Unregisters the connector from the ConnectorHud and disconnects it.
Declaration
public virtual void OnDestroy()
Start()
Initializes the connector, optionally connects it, and registers it with the ConnectorHud.
Declaration
public virtual void Start()