コード例 #1
0
        private void PerformLayoutControl(RectTransform rect, UnityAction <Component> action)
        {
            if ((UnityEngine.Object)rect == (UnityEngine.Object)null)
            {
                return;
            }
            List <Component> componentList = ListPool <Component> .Get();

            rect.GetComponents(typeof(ILayoutController), componentList);
            LayoutRebuilder.StripDisabledBehavioursFromList(componentList);
            if (componentList.Count > 0)
            {
                for (int index = 0; index < componentList.Count; ++index)
                {
                    if (componentList[index] is ILayoutSelfController)
                    {
                        action(componentList[index]);
                    }
                }
                for (int index = 0; index < componentList.Count; ++index)
                {
                    if (!(componentList[index] is ILayoutSelfController))
                    {
                        action(componentList[index]);
                    }
                }
                for (int index = 0; index < rect.childCount; ++index)
                {
                    this.PerformLayoutControl(rect.GetChild(index) as RectTransform, action);
                }
            }
            ListPool <Component> .Release(componentList);
        }
コード例 #2
0
        private void PerformLayoutControl(RectTransform rect, UnityAction <Component> action)
        {
            if (!(rect == null))
            {
                List <Component> list = ListPool <Component> .Get();

                rect.GetComponents(typeof(ILayoutController), list);
                LayoutRebuilder.StripDisabledBehavioursFromList(list);
                if (list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (list[i] is ILayoutSelfController)
                        {
                            action(list[i]);
                        }
                    }
                    for (int j = 0; j < list.Count; j++)
                    {
                        if (!(list[j] is ILayoutSelfController))
                        {
                            action(list[j]);
                        }
                    }
                    for (int k = 0; k < rect.childCount; k++)
                    {
                        this.PerformLayoutControl(rect.GetChild(k) as RectTransform, action);
                    }
                }
                ListPool <Component> .Release(list);
            }
        }
コード例 #3
0
 private static bool ValidController(RectTransform layoutRoot, List <Component> comps)
 {
     if ((UnityEngine.Object)layoutRoot == (UnityEngine.Object)null)
     {
         return(false);
     }
     layoutRoot.GetComponents(typeof(ILayoutController), comps);
     LayoutRebuilder.StripDisabledBehavioursFromList(comps);
     return(comps.Count > 0);
 }
コード例 #4
0
 private static bool ValidLayoutGroup(RectTransform parent, List <Component> comps)
 {
     if ((UnityEngine.Object)parent == (UnityEngine.Object)null)
     {
         return(false);
     }
     parent.GetComponents(typeof(ILayoutGroup), comps);
     LayoutRebuilder.StripDisabledBehavioursFromList(comps);
     return(comps.Count > 0);
 }
コード例 #5
0
        private static bool ValidController(RectTransform layoutRoot, List <Component> comps)
        {
            bool result;

            if (layoutRoot == null)
            {
                result = false;
            }
            else
            {
                layoutRoot.GetComponents(typeof(ILayoutController), comps);
                LayoutRebuilder.StripDisabledBehavioursFromList(comps);
                bool flag = comps.Count > 0;
                result = flag;
            }
            return(result);
        }
コード例 #6
0
        private static bool ValidLayoutGroup(RectTransform parent, List <Component> comps)
        {
            bool result;

            if (parent == null)
            {
                result = false;
            }
            else
            {
                parent.GetComponents(typeof(ILayoutGroup), comps);
                LayoutRebuilder.StripDisabledBehavioursFromList(comps);
                bool flag = comps.Count > 0;
                result = flag;
            }
            return(result);
        }
コード例 #7
0
        private void PerformLayoutCalculation(RectTransform rect, UnityAction <Component> action)
        {
            if (!(rect == null))
            {
                List <Component> list = ListPool <Component> .Get();

                rect.GetComponents(typeof(ILayoutElement), list);
                LayoutRebuilder.StripDisabledBehavioursFromList(list);
                if (list.Count > 0 || rect.GetComponent(typeof(ILayoutGroup)))
                {
                    for (int i = 0; i < rect.childCount; i++)
                    {
                        this.PerformLayoutCalculation(rect.GetChild(i) as RectTransform, action);
                    }
                    for (int j = 0; j < list.Count; j++)
                    {
                        action(list[j]);
                    }
                }
                ListPool <Component> .Release(list);
            }
        }
コード例 #8
0
        private void PerformLayoutCalculation(RectTransform rect, UnityAction <Component> action)
        {
            if ((UnityEngine.Object)rect == (UnityEngine.Object)null)
            {
                return;
            }
            List <Component> list = ListPool <Component> .Get();

            rect.GetComponents(typeof(ILayoutElement), list);
            LayoutRebuilder.StripDisabledBehavioursFromList(list);
            if (list.Count > 0)
            {
                for (int index = 0; index < rect.childCount; ++index)
                {
                    this.PerformLayoutCalculation(rect.GetChild(index) as RectTransform, action);
                }
                for (int index = 0; index < list.Count; ++index)
                {
                    action(list[index]);
                }
            }
            ListPool <Component> .Release(list);
        }