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); } } } }
public void ShowThisScreen(ScreenType _screenToShow, EnableDirection _direction, Action _tempAction = null) { _previousScreen = _currentScreen; ScreenView m_screen = FindScreen(_screenToShow); _currentScreen = _screenToShow; m_screen.Show(_direction); }
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); }
public virtual void OnNotify(CanvasState _currentState, EnableDirection _direction) { if (_currentState == CanvasState.Enabled) { StartShowAnimation(_direction); } else { StartHideAnimation(_direction); } }
// 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(); } }
// 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(); } }
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); }
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); } } }
public void HideThisScreen(ScreenType _screenToHide, EnableDirection _direction, Action _tempAction = null) { ScreenView m_screen = FindScreen(_screenToHide); m_screen.Hide(_direction); }
public override void Show(EnableDirection m_direction = EnableDirection.Forward) { base.ShowCanvas(m_direction); }
public override void Hide(EnableDirection m_direction = EnableDirection.Forward) { base.HideCanvas(m_direction); }
public override void HideAnimation(EnableDirection _direction, float _animationTime, Ease _animationEffect, TweenCallback _doThisOnFinish) { _currentCanvasGroup.alpha = 1; _currentCanvasGroup.DOFade(0, _animationTime).OnComplete(_doThisOnFinish); }
// Abstract Hide method public abstract void Hide(EnableDirection m_direction);
// Abstract show method public abstract void Show(EnableDirection m_direction);
public abstract void HideAnimation(EnableDirection _direction, float _animationTime, Ease _animationEffect, TweenCallback _doThisOnFinish);