Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
    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();
        }
    }