using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace FX { // Token: 0x02000770 RID: 1904 public static class GetAllChildren { // Token: 0x0600306F RID: 12399 RVA: 0x00104638 File Offset: 0x00104638 public static List GetAll(this GameObject obj) { List result = new List(); GetAllChildren.GetChildren(obj, ref result); return result; } // Token: 0x06003070 RID: 12400 RVA: 0x00104654 File Offset: 0x00104654 public static void GetChildren(GameObject obj, ref List allChildren) { Transform componentInChildren = obj.GetComponentInChildren(); if (componentInChildren.childCount == 0) { return; } IEnumerator enumerator = componentInChildren.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj2 = enumerator.Current; Transform transform = (Transform)obj2; allChildren.Add(transform.gameObject); GetAllChildren.GetChildren(transform.gameObject, ref allChildren); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } } // Token: 0x06003071 RID: 12401 RVA: 0x001046DC File Offset: 0x001046DC public static void GetComponentsInChildren(Transform trans, List components) where T : class { for (int i = 0; i < trans.childCount; i++) { Transform child = trans.GetChild(i); T component = child.GetComponent(); if (component != null) { components.Add(component); } GetAllChildren.GetComponentsInChildren(child, components); } } // Token: 0x06003072 RID: 12402 RVA: 0x00104728 File Offset: 0x00104728 public static void MapComponentsInChildren(Transform trans, Action func) where T : class { for (int i = 0; i < trans.childCount; i++) { Transform child = trans.GetChild(i); T component = child.GetComponent(); if (component != null) { func(component); } GetAllChildren.MapComponentsInChildren(child, func); } } } }