public static FindRecursive ( this transform, String name ) : |
||
transform | this | |
name | String | |
return |
public static Transform FindRecursive(this Transform transform, String name)
{
if (transform.name == name)
{
return transform;
}
foreach (Transform child in transform)
{
var result = FindRecursive(child, name);
if (result != null)
{
return result;
}
}
return null;
}