public static GameObject FindObjectWithTag(GameObject rootObj, string findTag) { if (rootObj == null) { return(null); } if (rootObj.get_tag() == findTag) { return(rootObj); } for (int i = 0; i < rootObj.get_transform().get_childCount(); i++) { GameObject gameObject = NgObject.FindObjectWithTag(rootObj.get_transform().GetChild(i).get_gameObject(), findTag); if (gameObject != null) { return(gameObject); } } return(null); }