public static GameObject FindChild(Transform transParent, string strChild)
{
GameObject go = null;
if (transParent != null)
{
if (transParent.name == strChild)
{
go = transParent.gameObject;
return go;
}
int childCount = transParent.childCount;
for (int i = 0; i < childCount; i++)
{
go = FindChild(transParent.GetChild(i), strChild);
if (go != null)
break;
}
}
return go;
}