IComponent

Interface mirroring UnityEngine.Component. Extends IUnityObject with access to Transform, GameObject, component queries (GetComponent, GetComponentInChildren, GetComponentInParent), tagging, and Unity's string-based message broadcasting system.

Definition

Namespace: Paragon Assembly: Paragon.dll

public interface IComponent : IUnityObject

Extends: IUnityObject

Remarks

IComponent is the largest interface in the Unity interface hierarchy, mirroring the full public API of UnityEngine.Component. It covers four categories:

  1. Scene graph accesstransform, gameObject, tag

  2. Component queries — All GetComponent / GetComponentInChildren / GetComponentInParent / GetComponents overloads (generic and non-generic)

  3. Taggingtag property and CompareTag() methods

  4. MessagingSendMessage, SendMessageUpwards, BroadcastMessage with all overloads

This interface is extended by IBehaviour and used by systems that need to access a component's Transform or query sibling components without depending on a concrete class.

Properties

transform

The Transform attached to this component's GameObject.

gameObject

The GameObject this component is attached to.

tag

The tag of the GameObject this component is attached to.

Methods

Component Queries

All standard Unity component query methods are included. The generic variants are most commonly used:

Non-generic overloads accepting System.Type and string are also included, as well as void overloads that write to a List<T> parameter for allocation-free queries:

Tag Comparison

Parameter
Type
Description

tag

string / TagHandle

Tag to compare against

Returns: true if the GameObject's tag matches.

Messaging

Unity's string-based messaging system. All overloads are included:

Implementation Requirements

circle-info

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

See Also

Last updated