public override void OnInspectorGUI() { bool anyHaveLayoutParent = false; for (int i = 0; i < targets.Length; i++) { Component comp = (targets[i] as Component); ILayoutIgnorer ignorer = comp.GetComponent(typeof(ILayoutIgnorer)) as ILayoutIgnorer; if (ignorer != null && ignorer.ignoreLayout) { continue; } RectTransform parent = comp.transform.parent as RectTransform; if (parent != null) { Behaviour layoutGroup = parent.GetComponent(typeof(ILayoutGroup)) as Behaviour; if (layoutGroup != null && layoutGroup.enabled) { anyHaveLayoutParent = true; break; } } } if (anyHaveLayoutParent) { EditorGUILayout.HelpBox(string.Format(s_Warning, ObjectNames.NicifyVariableName(target.GetType().Name)), MessageType.Warning); } }
/// <summary> /// <para>Called by the layout system.</para> /// </summary> public virtual void CalculateLayoutInputHorizontal() { this.m_RectChildren.Clear(); List <Component> results = ListPool <Component> .Get(); for (int i = 0; i < this.rectTransform.childCount; i++) { RectTransform child = this.rectTransform.GetChild(i) as RectTransform; if ((child != null) && child.gameObject.activeInHierarchy) { child.GetComponents(typeof(ILayoutIgnorer), results); if (results.Count == 0) { this.m_RectChildren.Add(child); } else { for (int j = 0; j < results.Count; j++) { ILayoutIgnorer ignorer = (ILayoutIgnorer)results[j]; if (!ignorer.ignoreLayout) { this.m_RectChildren.Add(child); break; } } } } } ListPool <Component> .Release(results); this.m_Tracker.Clear(); }
public virtual void CalculateLayoutInputHorizontal() { m_RectChildren.Clear(); List <Component> list = ListPool <Component> .Get(); for (int i = 0; i < this.rectTransform.childCount; i++) { RectTransform rectTransform = this.rectTransform.GetChild(i) as RectTransform; if (rectTransform == null || !rectTransform.gameObject.activeInHierarchy) { continue; } rectTransform.GetComponents(typeof(ILayoutIgnorer), list); if (list.Count == 0) { m_RectChildren.Add(rectTransform); continue; } for (int j = 0; j < list.Count; j++) { ILayoutIgnorer layoutIgnorer = (ILayoutIgnorer)list[j]; if (!layoutIgnorer.ignoreLayout) { m_RectChildren.Add(rectTransform); break; } } } ListPool <Component> .Release(list); m_Tracker.Clear(); }
/// <summary> /// <para>See Editor.OnInspectorGUI.</para> /// </summary> public override void OnInspectorGUI() { bool flag = false; for (int index = 0; index < this.targets.Length; ++index) { Component target = this.targets[index] as Component; ILayoutIgnorer component1 = target.GetComponent(typeof(ILayoutIgnorer)) as ILayoutIgnorer; if (component1 == null || !component1.ignoreLayout) { RectTransform parent = target.transform.parent as RectTransform; if ((Object)parent != (Object)null) { Behaviour component2 = parent.GetComponent(typeof(ILayoutGroup)) as Behaviour; if ((Object)component2 != (Object)null && component2.enabled) { flag = true; break; } } } } if (!flag) { return; } EditorGUILayout.HelpBox(string.Format(SelfControllerEditor.s_Warning, (object)ObjectNames.NicifyVariableName(this.target.GetType().Name)), MessageType.Warning); }
/// <summary> /// <para>See Editor.OnInspectorGUI.</para> /// </summary> public override void OnInspectorGUI() { bool flag = false; for (int i = 0; i < base.targets.Length; i++) { Component component = base.targets[i] as Component; ILayoutIgnorer ignorer = component.GetComponent(typeof(ILayoutIgnorer)) as ILayoutIgnorer; if ((ignorer == null) || !ignorer.ignoreLayout) { RectTransform parent = component.transform.parent as RectTransform; if (parent != null) { Behaviour behaviour = parent.GetComponent(typeof(ILayoutGroup)) as Behaviour; if ((behaviour != null) && behaviour.enabled) { flag = true; break; } } } } if (flag) { EditorGUILayout.HelpBox(string.Format(s_Warning, ObjectNames.NicifyVariableName(base.target.GetType().Name)), MessageType.Warning); } }
public virtual void CalculateLayoutInputHorizontal() { this.rectChildren.Clear(); for (int index = 0; index < ((Transform)this.rectTransform).get_childCount(); ++index) { RectTransform child = ((Transform)this.rectTransform).GetChild(index) as RectTransform; if (((Component)child).get_gameObject().get_activeInHierarchy()) { ILayoutIgnorer component = (ILayoutIgnorer)((Component)child).get_gameObject().GetComponent <ILayoutIgnorer>(); if (component == null || !component.get_ignoreLayout()) { this.rectChildren.Add(child); } } } }
public static int get_ignoreLayout(IntPtr l) { int result; try { ILayoutIgnorer layoutIgnorer = (ILayoutIgnorer)LuaObject.checkSelf(l); LuaObject.pushValue(l, true); LuaObject.pushValue(l, layoutIgnorer.ignoreLayout); result = 2; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public virtual void CalculateLayoutInputHorizontal() { this.m_RectChildren.Clear(); for (int i = 0; i < this.rectTransform.childCount; i++) { RectTransform child = this.rectTransform.GetChild(i) as RectTransform; if (child != null) { ILayoutIgnorer component = child.GetComponent(typeof(ILayoutIgnorer)) as ILayoutIgnorer; if (child.gameObject.activeInHierarchy && ((component == null) || !component.ignoreLayout)) { this.m_RectChildren.Add(child); } } } this.m_Tracker.Clear(); }
private void RebuildRectChildren() { rectChildren.Clear(); for (int i = 0; i < rectTransform.childCount; i++) { RectTransform rect = rectTransform.GetChild(i) as RectTransform; if (rect == null) { continue; } ILayoutIgnorer ignorer = rect.GetComponent(typeof(ILayoutIgnorer)) as ILayoutIgnorer; if (rect.gameObject.activeInHierarchy && !(ignorer != null && ignorer.ignoreLayout)) { rectChildren.Add(rect); } } }
// ILayoutElement Interface public virtual void CalculateLayoutInputHorizontal() { m_RectChildren.Clear(); for (int i = 0; i < rectTransform.childCount; i++) { RectTransform rect = rectTransform.GetChild(i) as RectTransform; if (rect == null) { continue; } ILayoutIgnorer ignorer = rect.GetComponent(typeof(ILayoutIgnorer)) as ILayoutIgnorer; if (rect.gameObject.activeInHierarchy && !(ignorer != null && ignorer.ignoreLayout)) { m_RectChildren.Add(rect); } } m_Tracker.Clear(); }
// Token: 0x06004702 RID: 18178 RVA: 0x00180DD4 File Offset: 0x0017F1D4 private List <RectTransform> GetUIElements() { List <RectTransform> list = new List <RectTransform>(); IEnumerator enumerator = base.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; Transform transform = (Transform)obj; list.Add(transform as RectTransform); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } if (this.SkipInactive) { list = (from x in list where x.gameObject.activeSelf select x).ToList <RectTransform>(); } if (this.Filter != null) { IEnumerable <GameObject> source = this.Filter(list.ConvertAll <GameObject>((RectTransform x) => x.gameObject)); list = (from x in source select x.transform as RectTransform).ToList <RectTransform>(); } return(list.Where(delegate(RectTransform x) { ILayoutIgnorer component = x.GetComponent <ILayoutIgnorer>(); return component == null || !component.ignoreLayout; }).ToList <RectTransform>()); }
private void CalculateLayout() { if (this.RectChildren.Count < 0) { return; } rectChildren.Clear(); for (int i = 0; i < RectTransform.childCount; i++) { RectTransform rect = RectTransform.GetChild(i) as RectTransform; if (rect == null) { continue; } ILayoutIgnorer ignorer = rect.GetComponent(typeof(ILayoutIgnorer)) as ILayoutIgnorer; if (rect.gameObject.activeInHierarchy && !(ignorer != null && ignorer.ignoreLayout)) { rectChildren.Add(rect); } } tracker.Clear(); }