IBehaviour

Interface mirroring UnityEngine.Behaviour. Extends IComponent with the ability to enable/disable the behaviour and query its active state. This is the interface-level equivalent of the enabled toggle on Unity components.

Definition

Namespace: Paragon Assembly: Paragon.dll

public interface IBehaviour : IComponent

Extends: IComponent

Remarks

IBehaviour adds the two properties that distinguish Behaviour from Component in Unity's hierarchy:

  • enabled — Can be toggled to enable/disable the behaviour, which controls whether Unity lifecycle callbacks (Update, OnGUI, etc.) are invoked.

  • isActiveAndEnabled — Combines enabled with the GameObject's active state (gameObject.activeInHierarchy && enabled).

This interface is extended by IMonoBehaviour, which adds coroutine and invoke support.

Properties

enabled

Gets or sets whether this behaviour is enabled. When false, Unity does not call lifecycle methods (Update, LateUpdate, FixedUpdate, OnGUI, etc.) on this component.

bool enabled { get; set; }

isActiveAndEnabled

Returns true only when both the behaviour is enabled and the GameObject is active in the hierarchy. Read-only.

Implementation Requirements

circle-info

You do not need to implement this interface explicitly. Any class deriving from UnityEngine.Behaviour (including all MonoBehaviour subclasses) already has these members.

See Also

Last updated