示例#1
0
    public void SetPage(MenuPage _page, bool _outAnim = true, bool _inAnim = true)
    {
        nextPage = _page;
        InAnim   = _inAnim;

        if (currentPage)
        {
            if (_outAnim)
            {
                currentPage.AnimateOut();
            }
        }

        if (!currentPage || currentPage.IsAnimationFinished())
        {
            if (currentPage != null)
            {
                currentPage.gameObject.SetActive(false);
            }

            currentPage = nextPage;
            nextPage    = null;
            currentPage.gameObject.SetActive(true);
            currentPage.OnSetPage();
            if (_inAnim)
            {
                currentPage.AnimateIn();
            }
        }
    }