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(); } } }
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(); } } }
public virtual void Update() { if (nextPage) { if (currentPage.IsAnimationFinished()) { currentPage.gameObject.SetActive(false); currentPage = nextPage; nextPage = null; currentPage.gameObject.SetActive(true); currentPage.OnSetPage(); if (InAnim) { currentPage.AnimateIn(); } } } }
public virtual void Update() { if(nextPage) { if(currentPage.IsAnimationFinished()) { currentPage.gameObject.SetActive(false); currentPage = nextPage; nextPage = null; currentPage.gameObject.SetActive(true); currentPage.OnSetPage(); if(InAnim) { currentPage.AnimateIn(); } } } }