예제 #1
0
        protected virtual void OpenAnimation()
        {
            OwnGameObject.SetActive(true);

            if (UseFader)
            {
                FaderManager.FadeInGame();
            }

            if (EnterAnimation.Animation != null)
            {
                if (EnterAnimation.Animation is PYAnimator)
                {
                    ((PYAnimator)EnterAnimation.Animation).Play(EnterAnimation.Tag, Opened);
                }
                else
                {
                    EnterAnimation.Animation.Play(Opened);
                }
            }
            else
            {
                OwnGameObject.SetActive(true);
                Opened();
            }
        }
예제 #2
0
        protected virtual void CloseAnimation()
        {
            if (CloseFaderByPopup)
            {
                FaderManager.FadeOutGame();
            }

            if (useEnterAnimationAsExit)
            {
                if (EnterAnimation.Animation is PYAnimator)
                {
                    ((PYAnimator)EnterAnimation.Animation).Reverse(EnterAnimation.Tag, Closed);
                }
                else
                {
                    EnterAnimation.Animation.Reverse(Closed);
                }
            }
            else if (ExitAnimation.Animation != null)
            {
                if (ExitAnimation.Animation is PYAnimator)
                {
                    ((PYAnimator)ExitAnimation.Animation).Play(ExitAnimation.Tag, Closed);
                }
                else
                {
                    ExitAnimation.Animation.Play(Closed);
                }
            }
            else
            {
                if (DeactiveOnClosed)
                {
                    OwnGameObject.SetActive(false);
                }
                Closed();
            }
        }
예제 #3
0
        protected virtual void Start()
        {
            useEnterAnimationAsExit = EnterAnimation.Animation != null && ExitAnimation.Animation == null;

            if (UseFader && ClosePopupByFader)
            {
                FaderManager.GameFade.OnFaderClick += Close;
            }
            if (!_calledOpenBeforeStart)
            {
                if (!IsOpen)
                {
                    OwnGameObject.SetActive(false);
                }
                else
                {
                    Opened();
                    if (UseFader)
                    {
                        FaderManager.GameFade.Initialize();
                    }
                }
            }
        }