UnityEngine.UI.GridLayoutGroup.CalculateLayoutInputHorizontal C# (CSharp) Method

CalculateLayoutInputHorizontal() public method

Called by the layout system.

public CalculateLayoutInputHorizontal ( ) : void
return void
        public override void CalculateLayoutInputHorizontal()
        {
            base.CalculateLayoutInputHorizontal();
            int num = 0;
            int num2 = 0;
            if (this.m_Constraint == Constraint.FixedColumnCount)
            {
                num = num2 = this.m_ConstraintCount;
            }
            else if (this.m_Constraint == Constraint.FixedRowCount)
            {
                num = num2 = Mathf.CeilToInt((((float) base.rectChildren.Count) / ((float) this.m_ConstraintCount)) - 0.001f);
            }
            else
            {
                num = 1;
                num2 = Mathf.CeilToInt(Mathf.Sqrt((float) base.rectChildren.Count));
            }
            base.SetLayoutInputForAxis((base.padding.horizontal + ((this.cellSize.x + this.spacing.x) * num)) - this.spacing.x, (base.padding.horizontal + ((this.cellSize.x + this.spacing.x) * num2)) - this.spacing.x, -1f, 0);
        }

Usage Example

コード例 #1
0
 static public int CalculateLayoutInputHorizontal(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.UI.GridLayoutGroup self = (UnityEngine.UI.GridLayoutGroup)checkSelf(l);
         self.CalculateLayoutInputHorizontal();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
All Usage Examples Of UnityEngine.UI.GridLayoutGroup::CalculateLayoutInputHorizontal