Summary
Tries various search methods in the following order until it finds something:
UnityEngine.GameObject.GetComponent(System.Type),
UnityEngine.GameObject.GetComponentsInParent(System.Type,System.Boolean),
UnityEngine.GameObject.GetComponentsInChildren(System.Type,System.Boolean),
UnityEngine.Resources.FindObjectsOfTypeAll(System.Type).
In the first group where a component of the correct type is found, if multiple components were found the
one with a name closest to the `nameHint` is chosen.
Syntax
public static Component ProgressiveSearch(GameObject gameObject, Type componentType, string nameHint)
Parameters
| Name |
Type |
Description |
| gameObject |
GameObject |
|
| componentType |
Type |
|
| nameHint |
string |
|
Return Value
| Type |
Description |
| Component |
|