Esempio n. 1
0
        public static float GetLayoutProperty(RectTransform rect, Func <ILayoutElement, float> property, float defaultValue)
        {
            ILayoutElement layoutElement;

            return(LayoutUtility.GetLayoutProperty(rect, property, defaultValue, out layoutElement));
        }
Esempio n. 2
0
 public static float GetPreferredHeight(RectTransform rect)
 {
     return(Mathf.Max(LayoutUtility.GetLayoutProperty(rect, (ILayoutElement e) => e.minHeight, 0f), LayoutUtility.GetLayoutProperty(rect, (ILayoutElement e) => e.preferredHeight, 0f)));
 }
Esempio n. 3
0
 public static float GetFlexibleHeight(RectTransform rect)
 {
     return(LayoutUtility.GetLayoutProperty(rect, (ILayoutElement e) => e.flexibleHeight, 0f));
 }
Esempio n. 4
0
 public static float GetMinWidth(RectTransform rect)
 {
     return(LayoutUtility.GetLayoutProperty(rect, (ILayoutElement e) => e.minWidth, 0f));
 }
 public float GetPreferredWidth(RectTransform rect)
 {
     return(Mathf.Max(LayoutUtility.GetLayoutProperty(rect, (ILayoutElement e) => e.minWidth, 0f), this.GetLayoutProperty(rect, (ILayoutElement e) => e.preferredWidth, 0f)));
 }
Esempio n. 6
0
 /// <summary>
 ///   <para>Returns the minimum height of the layout element.</para>
 /// </summary>
 /// <param name="rect">The RectTransform of the layout element to query.</param>
 public static float GetMinHeight(RectTransform rect)
 {
     return(LayoutUtility.GetLayoutProperty(rect, (Func <ILayoutElement, float>)(e => e.minHeight), 0.0f));
 }
Esempio n. 7
0
 /// <summary>
 ///   <para>Returns the flexible width of the layout element.</para>
 /// </summary>
 /// <param name="rect">The RectTransform of the layout element to query.</param>
 public static float GetFlexibleWidth(RectTransform rect)
 {
     return(LayoutUtility.GetLayoutProperty(rect, (Func <ILayoutElement, float>)(e => e.flexibleWidth), 0.0f));
 }
Esempio n. 8
0
 /// <summary>
 ///   <para>Returns the preferred width of the layout element.</para>
 /// </summary>
 /// <param name="rect">The RectTransform of the layout element to query.</param>
 public static float GetPreferredWidth(RectTransform rect)
 {
     return(Mathf.Max(LayoutUtility.GetLayoutProperty(rect, (Func <ILayoutElement, float>)(e => e.minWidth), 0.0f), LayoutUtility.GetLayoutProperty(rect, (Func <ILayoutElement, float>)(e => e.preferredWidth), 0.0f)));
 }