Method GetRequiredComponentInChildren
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
GetRequiredComponentInChildren<T>(Component)
Gets a component of the given type in one of the children, or fail if no such component is attached to the given component.
public static T GetRequiredComponentInChildren<T>(this Component thisComponent) where T : Component
Parameters
thisComponent
ComponentThe component to check.
Returns
- T
A component of type T attached to the given component if it exists.
Type Parameters
T
The type of component to get.
Exceptions
- InvalidOperationException
When the no component of the required type exist on any of the given components children.