Method GetComponentInParent
GetComponentInParent<T>()
Retrieves the component of Type T in the GameObject or any of its parents
Declaration
public T GetComponentInParent<T>() where T : Component
Returns
Type | Description |
---|---|
T | Returns a 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
GetComponentInParent<T>(Component)
Retrieves the component of Type T in the GameObject or any of its parents
Declaration
public T GetComponentInParent<T>(Component component) where T : Component
Parameters
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
GetComponentInParent<T>(GameObject)
Retrieves the component of Type T in the GameObject or any of its parents
Declaration
public T GetComponentInParent<T>(GameObject gameObject) where T : Component
Parameters
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