private void destroyLayoutObjects() { foreach (Transform transform in TransformExtensions.GetChildren(base.transform, false)) { UnityEngine.Object.DestroyImmediate(transform.gameObject); } }
protected void Awake() { this.RectTm = base.GetComponent <RectTransform>(); Transform[] children = TransformExtensions.GetChildren(this.LockedContentRoot.transform, false); for (int i = 0; i < children.Length; i++) { TransformAnimation item = GameObjectExtensions.AddOrGetComponent <TransformAnimation>(children[i].gameObject); this.m_lockedContentTransformAnimations.Add(item); RectTransform transform = children[i].GetComponent <RectTransform>(); this.m_lockedContentRectTransforms.Add(item, transform); this.m_lockedContentOriginalAnchoredPositions.Add(item, transform.anchoredPosition); Image image = children[i].GetComponent <Image>(); MenuOverlay overlay = GameObjectExtensions.AddOrGetComponent <MenuOverlay>(children[i].gameObject); overlay.Image = image; this.m_lockedContentImages.Add(item, overlay); } this.m_dummyRectTmObj = new GameObject("DummyRectTm").AddComponent <RectTransform>(); this.m_dummyRectTmObj.sizeDelta = Vector2.zero; this.m_dummyRectTmObj.SetParent(this.LockedContentRoot.transform, false); this.m_dimmableImages.Clear(); Image component = this.BackgroundCanvas.GetComponent <Image>(); this.m_dimmableImages.Add(component); this.m_dimmableImageOriginalColors.Add(component, component.color); Image[] componentsInChildren = this.OpenContentRoot.GetComponentsInChildren <Image>(); for (int j = 0; j < componentsInChildren.Length; j++) { this.m_dimmableImages.Add(componentsInChildren[j]); this.m_dimmableImageOriginalColors.Add(componentsInChildren[j], componentsInChildren[j].color); } }
public static void SetStaticRecursively(GameObject self, bool flag) { self.isStatic = flag; Transform[] children = TransformExtensions.GetChildren(self.transform, true); for (int i = children.Length - 1; i >= 0; i--) { children[i].gameObject.isStatic = flag; } }
public static void SetLayerRecursively(GameObject self, int layer) { self.layer = layer; Transform[] children = TransformExtensions.GetChildren(self.transform, true); for (int i = children.Length - 1; i >= 0; i--) { children[i].gameObject.layer = layer; } }