ControllableComponent¶
Abstract MonoBehaviour that routes begin/end triggers to subclass-defined actions via a pluggable execution frame.
Namespace: Jungle.Processes
Inherits: JungleBehaviour → MonoBehaviour
Implements: ICycleProvider<MonoCycle>
Overview¶
ControllableComponent provides a frame-driven lifecycle for MonoBehaviours. Each instance has an execution frame (IExecutionFrame) that decides when OnBegin() and OnEnd() fire. The frame is configured in the Inspector via the class-selection dropdown and can be a MonoBehaviour phase pair, a pair of events, a cycle on another component, or purely external (manual Begin()/End() calls).
Properties¶
| Property | Type | Description |
|---|---|---|
| executionFrame | IExecutionFrame |
Decides when Begin and End fire. Default: MonoLifecycleFrame(EnableDisable). |
| IsExecuting | bool |
True between Begin and End -- the component's frame is currently running. |
| Began | event Action |
Raised as Begin fires, before the subclass's own logic runs. |
| Ended | event Action |
Raised after End has finished the subclass's own logic. |
Execution Frame Implementations¶
| Frame | Description |
|---|---|
MonoLifecycleFrame |
Fires on a MonoBehaviour phase pair (EnableDisable, StartDestroy, or AwakeDestroy) on this component. Default. |
EventPairFrame |
Fires when a begin IEvent triggers; ends when an end IEvent triggers. |
ExternalFrame |
No automatic triggering -- only fires via manual Begin()/End() calls from code. |
ComponentCycleFrame<T, K> |
Subscribes to a named cycle on another ICycleProvider component. |
ControllableCycleFrame |
Watches another ControllableComponent's own Begin and End. Leave the provider empty to auto-resolve to another Jungle component on the same object. |
ProcessFinishedFrame |
Begins when another ProcessComponent's run finishes on its own (right away if it already has). Stops when that component starts again, never, or on an IEvent. |
Public API¶
| Method | Description |
|---|---|
Begin() |
Triggers the begin action. Sets IsExecuting to true and raises Began. |
End() |
Triggers the end action. Sets IsExecuting to false and raises Ended. |