Method GetComponent
GetComponent(GameObject)
Gets a single component of type T using the non-allocating GetComponents API.
Declaration
public static T GetComponent(GameObject gameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | gameObject | The GameObject from which to get the component. |
Returns
| Type | Description |
|---|---|
| T | The component, if one exists. |