Ejemplo n.º 1
0
        public void TestCalculateLayoutInputHorizontal()
        {
            m_LayoutGroup.CalculateLayoutInputHorizontal();
            m_LayoutGroup.SetLayoutHorizontal();
            m_LayoutGroup.CalculateLayoutInputVertical();
            m_LayoutGroup.SetLayoutVertical();

            Assert.AreEqual(31, m_LayoutGroup.minWidth);
            Assert.AreEqual(206, m_LayoutGroup.preferredWidth);
            Assert.AreEqual(1, m_LayoutGroup.flexibleWidth);
        }
 // Update is called once per frame
 void Update()
 {
     Canvas.ForceUpdateCanvases();
     hlg.CalculateLayoutInputHorizontal();
     hlg.CalculateLayoutInputVertical();
     hlg.SetLayoutHorizontal();
     hlg.SetLayoutVertical();
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        VerticalLayoutGroup hlg = gameObject.GetComponent <VerticalLayoutGroup>();

        Canvas.ForceUpdateCanvases();
        hlg.CalculateLayoutInputHorizontal();
        hlg.CalculateLayoutInputVertical();
        hlg.SetLayoutHorizontal();
        hlg.SetLayoutVertical();
    }
    // HACK: Fix for an issue caused by the combined use of nested layout groups and content size fitter
    private IEnumerator ResetLayoutGroup()
    {
        yield return(new WaitForEndOfFrame());

        VerticalLayoutGroup verticalLayoutGroup = GetComponentInChildren <VerticalLayoutGroup>();

        verticalLayoutGroup.CalculateLayoutInputHorizontal();
        verticalLayoutGroup.CalculateLayoutInputVertical();
        verticalLayoutGroup.SetLayoutHorizontal();
        verticalLayoutGroup.SetLayoutVertical();
        yield break;
    }
    public static int CalculateLayoutInputHorizontal(IntPtr l)
    {
        int result;

        try
        {
            VerticalLayoutGroup verticalLayoutGroup = (VerticalLayoutGroup)LuaObject.checkSelf(l);
            verticalLayoutGroup.CalculateLayoutInputHorizontal();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Ejemplo n.º 6
0
        private IEnumerator FadeInOut(float toastDuration, float fadeDuration)
        {
            yield return(null);

            uiContentVerticalLayoutGroup.CalculateLayoutInputHorizontal();
            uiContentVerticalLayoutGroup.CalculateLayoutInputVertical();
            uiContentVerticalLayoutGroup.SetLayoutHorizontal();
            uiContentVerticalLayoutGroup.SetLayoutVertical();
            yield return(null);

            // Anim start
            yield return(Fade(uiCanvasGroup, 0f, 1f, fadeDuration));

            yield return(new WaitForSeconds(toastDuration));

            yield return(Fade(uiCanvasGroup, 1f, 0f, fadeDuration));
            // Anim end
        }