Ejemplo n.º 1
0
 public void StartShowAnimation(EnableDirection _direction)
 {
     if (!hasAnimationComponent)
     {
         Initialize();
     }
     if (hasAnimationComponent)
     {
         if (hasCanvas)
         {
             _canvas.enabled = true;
         }
         for (int count = 0; count < _animationComponents.Length; count++)
         {
             _animationComponents[count].ShowAnimation(_direction, showAnimationTime, showAnimationEffect, ShowAnimationComplete);
         }
         if (_currentUIBase)
         {
             _currentUIBase.OnElementShowAnimationStarted(this);
         }
         else
         {
             if (!hasCanvas)
             {
                 gameObject.SetActive(true);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void ShowThisScreen(ScreenType _screenToShow, EnableDirection _direction, Action _tempAction = null)
 {
     _previousScreen = _currentScreen;
     ScreenView m_screen = FindScreen(_screenToShow);
     _currentScreen = _screenToShow;
     m_screen.Show(_direction);
 }
Ejemplo n.º 3
0
 public override void HideAnimation(EnableDirection _direction, float _animationTime, Ease _animationEffect, TweenCallback _doThisOnFinish)
 {
     if (m_targetTransform == null)
     {
         Debug.Log("Please SetupAnimation before starting the animation");
     }
     m_targetTransform.DOScale(_scaleFrom, _animationTime).SetEase(_animationEffect).OnComplete(_doThisOnFinish);
 }
Ejemplo n.º 4
0
 public virtual void OnNotify(CanvasState _currentState, EnableDirection _direction)
 {
     if (_currentState == CanvasState.Enabled)
     {
         StartShowAnimation(_direction);
     }
     else
     {
         StartHideAnimation(_direction);
     }
 }
Ejemplo n.º 5
0
 // Show Canvas method to enable canvas component
 protected void ShowCanvas(EnableDirection m_direction)
 {
     _direction    = m_direction;
     _currentState = CanvasState.Enabled;
     OnScreenShowCalled();
     EnableDisableCanvas(true);
     if (m_showAnimationListeners.Count <= 0)
     {
         OnScreenLoaded();
     }
 }
Ejemplo n.º 6
0
 // Hide Canvas method to disable canvas component
 protected void HideCanvas(EnableDirection m_direction)
 {
     _direction    = m_direction;
     _currentState = CanvasState.Disabled;
     OnScreenHideCalled();
     // Debug.Log("---m_hideAnimationListener "+m_hideAnimationListeners.Count,gameObject);
     if (m_hideAnimationListeners.Count <= 0)
     {
         EnableDisableCanvas(false);
         OnScreenHidden();
     }
 }
Ejemplo n.º 7
0
        public override void HideAnimation(EnableDirection _direction, float contentMoveTime, Ease _animationEffect, TweenCallback doThisOnFinish)
        {
            StopPreviousAnimation();
            if (m_targetTransform == null)
            {
                Debug.Log("Please Setup Animation before starting the animation");
                return;
            }
            Vector2 m_tempStartPos = _moveFromPosition;

            //Debug.Log(_direction);
            if (_direction == EnableDirection.Reverse)
            {
                m_tempStartPos = GetStartPosition();
            }
            m_targetTransform.DOLocalMove(m_tempStartPos, contentMoveTime).SetEase(_animationEffect).OnComplete(doThisOnFinish);
        }
Ejemplo n.º 8
0
 public void StartHideAnimation(EnableDirection _direction)
 {
     if (!hasAnimationComponent)
     {
         Initialize();
     }
     if (hasAnimationComponent)
     {
         for (int count = 0; count < _animationComponents.Length; count++)
         {
             _animationComponents[count].HideAnimation(_direction, hideAnimationTime, hideAnimationEffect, HideAnimationComplete);
         }
         if (_currentUIBase)
         {
             _currentUIBase.OnElementHideAnimationStarted(this);
         }
     }
 }
Ejemplo n.º 9
0
 public void HideThisScreen(ScreenType _screenToHide, EnableDirection _direction, Action _tempAction = null)
 {
     ScreenView m_screen = FindScreen(_screenToHide);
     m_screen.Hide(_direction);
 }
Ejemplo n.º 10
0
 public override void Show(EnableDirection m_direction = EnableDirection.Forward)
 {
     base.ShowCanvas(m_direction);
 }
Ejemplo n.º 11
0
 public override void Hide(EnableDirection m_direction = EnableDirection.Forward)
 {
     base.HideCanvas(m_direction);
 }
Ejemplo n.º 12
0
 public override void HideAnimation(EnableDirection _direction, float _animationTime, Ease _animationEffect, TweenCallback _doThisOnFinish)
 {
     _currentCanvasGroup.alpha = 1;
     _currentCanvasGroup.DOFade(0, _animationTime).OnComplete(_doThisOnFinish);
 }
Ejemplo n.º 13
0
 // Abstract Hide method
 public abstract void Hide(EnableDirection m_direction);
Ejemplo n.º 14
0
 // Abstract show method
 public abstract void Show(EnableDirection m_direction);
Ejemplo n.º 15
0
 public abstract void HideAnimation(EnableDirection _direction, float _animationTime, Ease _animationEffect, TweenCallback _doThisOnFinish);