Type:IComponent: Difference between revisions

From Resonite Wiki
Explain IComponent and how the casting works. Feel free to link Casting instead.
m typo
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
IComponent is a component reference interface. Since it is an interface, it only allows interacting with the component in ways that all components can be interacted with. As such, this type can store any [[Component]] reference, no matter what kind of component it is.
IComponent is an [[Interface Type|Interface]] for any [[Component]].
 
This type can be casted into a specific component, and the cast will give this type as the casted component type, provided the component stored in this data type is actually that component. For example, you can't cast the contents of an IComponent reference storing an [[ObjectRoot (Component)|ObjectRoot]] into a [[CopyGlobalTransform (Component)|CopyGlobalTransform]] or it will give null, to name one of many.
[[Category:Type]]
[[Category:Type]]

Latest revision as of 18:01, 9 February 2024

IComponent is an Interface for any Component.