component | The component to search for. |
int
The index of the specified Component if it exists. Otherwise, returns -1
.
Retrieves the index of the specified component in the array of components attached to the GameObject.