private static bool HasComponents(Transform transform, Type t) { bool flag; if (transform.GetComponent(t) != null) { return(true); } IEnumerator enumerator = transform.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform current = (Transform)enumerator.Current; if (PrefabPreProcess.ShouldExclude(current) || !PrefabPreProcess.HasComponents(current, t)) { continue; } flag = true; return(flag); } return(false); } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } return(flag); }
private static bool HasComponents(Transform transform, System.Type t) { if (Object.op_Inequality((Object)((Component)transform).GetComponent(t), (Object)null)) { return(true); } IEnumerator enumerator = transform.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform current = (Transform)enumerator.Current; if (!PrefabPreProcess.ShouldExclude(current) && PrefabPreProcess.HasComponents(current, t)) { return(true); } } } finally { (enumerator as IDisposable)?.Dispose(); } return(false); }
private static bool HasComponents <T>(Transform transform) { if ((object)((Component)transform).GetComponent <T>() != null) { return(true); } IEnumerator enumerator = transform.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform current = (Transform)enumerator.Current; if (!PrefabPreProcess.ShouldExclude(current) && PrefabPreProcess.HasComponents <T>(current)) { return(true); } } } finally { (enumerator as IDisposable)?.Dispose(); } return(false); }
public static void FindComponents(Transform transform, List <Component> list, Type t) { list.AddRange(transform.GetComponents(t)); foreach (Transform transforms in transform) { if (PrefabPreProcess.ShouldExclude(transforms)) { continue; } PrefabPreProcess.FindComponents(transforms, list, t); } }
public static void FindComponents(Transform transform, List <Component> list, System.Type t) { list.AddRange((IEnumerable <Component>)((Component)transform).GetComponents(t)); IEnumerator enumerator = transform.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform current = (Transform)enumerator.Current; if (!PrefabPreProcess.ShouldExclude(current)) { PrefabPreProcess.FindComponents(current, list, t); } } } finally { (enumerator as IDisposable)?.Dispose(); } }