예제 #1
0
    public void HideChildren(FreeUIObject[] children, bool instantly, LayoutActionCompleted onCompleted)
    {
        if (waitForHideFunction != null)
        {
            StopCoroutine(waitForHideFunction);
            waitForHideFunction = null;
        }

        if (instantly)
        {
            for (int i = 0; i < children.Length; i++)
            {
                children [i].Hide(true);
            }

            if (onCompleted != null)
            {
                onCompleted();
            }
        }
        else
        {
            waitForHideFunction = WaitOnChildren(children, true, onCompleted);

            StartCoroutine(waitForHideFunction);
        }
    }
예제 #2
0
    IEnumerator WaitOnChildren(FreeUIObject[] children, bool waitOnHide, LayoutActionCompleted onCompleted)
    {
        bool waiting = true;

        for (int i = 0; i < children.Length; i++)
        {
            if (!waitOnHide)
            {
                children [i].Show(false);
            }
            else
            {
                children [i].Hide(false);
            }
        }

        while (waiting)
        {
            waiting = false;

            for (int i = 0; i < children.Length; i++)
            {
                if (!waitOnHide)
                {
                    if (!children [i].IsInteractive())
                    {
                        waiting = true;
                    }
                }
                else
                {
                    if (children[i].IsUIObjectVisible())
                    {
                        waiting = true;
                    }
                }
            }

            yield return(eof);
        }

        if (onCompleted != null)
        {
            onCompleted();
        }

        if (waitOnHide)
        {
            waitForHideFunction = null;
        }
        else
        {
            waitForShowFunction = null;
        }
    }
예제 #3
0
    void LayoutHidden()
    {
        if (_layoutHidden != null)
        {
            _layoutHidden();
        }

        _layoutHidden = null;

        CachedGameObject.SetActive(false);
    }
예제 #4
0
    public void HideLayout(bool instantly, LayoutActionCompleted onCompleted)
    {
        if (alwaysHideInstantly)
        {
            instantly = true;
        }

        _layoutHidden = onCompleted;

        _layoutShowCompleted = null;
        _layoutHideCompleted = onCompleted;

        OnHideLayout(instantly, LayoutHidden);
    }
예제 #5
0
    public void ShowLayout(bool instantly, LayoutActionCompleted onCompleted)
    {
        Initialize();

        if (alwaysShowInstantly)
        {
            instantly = true;
        }

        CachedGameObject.SetActive(true);

        _layoutShowCompleted = onCompleted;
        _layoutHideCompleted = null;

        OnShowLayout(instantly, onCompleted);

        RefreshLayout();
    }
예제 #6
0
 public abstract void OnHideLayout(bool instantly, LayoutActionCompleted onCompleted);