private static T TryToFindComponent <T>(GameObject gameObject, string name) where T : Component { T component = default(T); if (name.Length > 0) { component = GameObjectUtil.FindChildComponentByName <T>( gameObject.transform.root.gameObject, name); } return(component); }