GameObject.GetComponentIndex

Switch to Manual

Declaration

public int GetComponentIndex(Component component);

Parameters

component The component to search for.

Returns

int The index of the specified Component if it exists. Otherwise, returns -1.

Description

Retrieves the index of the specified component in the array of components attached to the GameObject.


Did you find this page useful? Please give it a rating: