ITargetHolder.GetComponent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| GetComponent(Type) |
Gets the component with the specified type. |
| GetComponent<TComponent>() |
Gets the component with the specified type. |
GetComponent(Type)
Gets the component with the specified type.
public object? GetComponent(Type componentType);
abstract member GetComponent : Type -> obj
Public Function GetComponent (componentType As Type) As Object
Parameters
- componentType
- Type
The component type.
Returns
The component with the specified type.
Applies to
GetComponent<TComponent>()
Gets the component with the specified type.
public TComponent GetComponent<TComponent>() where TComponent : class;
public TComponent? GetComponent<TComponent>() where TComponent : class;
abstract member GetComponent : unit -> 'Component (requires 'Component : null)
Public Function GetComponent(Of TComponent As Class) () As TComponent
Type Parameters
- TComponent
The component type.
Returns
The component with the specified type.