Method GetComponentInChildren
GetComponentInChildren<T>()
Returns the component of Type T in the GameObject or any of its children using depth first search
Declaration
public T GetComponentInChildren<T>() where T : ComponentReturns
| Type | Description | 
|---|---|
| T | The component if a component matching the type is found, null otherwise | 
Type Parameters
| Name | Description | 
|---|---|
| T | The type of component to retrieve | 
Remarks
This will take a dependency on the component
GetComponentInChildren<T>(Component)
Returns the component of Type T in the GameObject or any of its children using depth first search
Declaration
public T GetComponentInChildren<T>(Component component) where T : ComponentParameters
| Type | Name | Description | 
|---|---|---|
| Component | component | The Object to get the component from | 
Returns
| Type | Description | 
|---|---|
| T | The component if a component matching the type is found, null otherwise | 
Type Parameters
| Name | Description | 
|---|---|
| T | The type of component to retrieve | 
Remarks
This will take a dependency on the component
GetComponentInChildren<T>(GameObject)
Returns the component of Type T in the GameObject or any of its children using depth first search
Declaration
public T GetComponentInChildren<T>(GameObject gameObject) where T : ComponentParameters
| Type | Name | Description | 
|---|---|---|
| GameObject | gameObject | The GameObject to get the component from | 
Returns
| Type | Description | 
|---|---|
| T | The component if a component matching the type is found, null otherwise | 
Type Parameters
| Name | Description | 
|---|---|
| T | The type of component to retrieve | 
Remarks
This will take a dependency on the component