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 : IUnityObjectExtends: IUnityObject
Remarks
IComponent is the largest interface in the Unity interface hierarchy, mirroring the full public API of UnityEngine.Component. It covers four categories:
Scene graph access —
transform,gameObject,tagComponent queries — All
GetComponent/GetComponentInChildren/GetComponentInParent/GetComponentsoverloads (generic and non-generic)Tagging —
tagproperty andCompareTag()methodsMessaging —
SendMessage,SendMessageUpwards,BroadcastMessagewith 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
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
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
IUnityObject — parent interface
IBehaviour — extends this with enable/disable
Unity Interfaces — hierarchy overview
Last updated