/// <summary> /// Show previous screen with animation /// </summary> /// <param name="navigationController"></param> private void ShowNavigationOfPreviousScreen(IUIScreenController previousScreen, UIScreenAnimationSettings animationSetting, object data) { if (CheckOfScreen(previousScreen.screenID)) { return; } previousScreen.SetData(data); //get revert animation settings UIScreenAnimationSettings revertAnimationSEtting = new UIScreenAnimationSettings(); revertAnimationSEtting.SetRevertType(animationSetting); UIScreenAnimationManager.Instance.StartAnimateNavigation(revertAnimationSEtting, previousScreen, _currentScreen); ChangeCurrentScreen(previousScreen); }
/*Logic * */ public void StartAnimateNavigation(UIScreenAnimationSettings settings, IUIScreenController nextUIScreen = null, IUIScreenController currentUIScreen = null) { _animtionSettings = settings; _nextUIScreen = nextUIScreen.baseGameObject; _currentUIScreen = currentUIScreen.baseGameObject; _nextUIScreenTween.rectTransform = nextUIScreen.baseRectTransform; _nextUIScreenTween.ChangeSetState(false); _currentUIScreenTween.rectTransform = currentUIScreen.baseRectTransform; _currentUIScreenTween.ChangeSetState(false); //set layer position UIScreensLayerPositions(); //set uration of tweens SetDuration(); //set tween settings SetAnimationParams(); //start animations StartAnimation(); }
public void SetRevertType(UIScreenAnimationSettings animationSetting) { _duration = animationSetting.duration; _animationCurve = animationSetting.animationCurve; _staticNextUIScreen = animationSetting.staticNextUIScreen; _staticCurrentUIScreen = animationSetting.staticCurrentUIScreen; if (animationSetting.uiScreenAnimationType == EnumUIScreenAnimationType.slideBottomTop) { _uiScreenAnimationType = EnumUIScreenAnimationType.slideTopBottom; } if (animationSetting.uiScreenAnimationType == EnumUIScreenAnimationType.slideLeftRight) { _uiScreenAnimationType = EnumUIScreenAnimationType.slideRightLeft; } if (animationSetting.uiScreenAnimationType == EnumUIScreenAnimationType.slideRightLeft) { _uiScreenAnimationType = EnumUIScreenAnimationType.slideLeftRight; } if (animationSetting.uiScreenAnimationType == EnumUIScreenAnimationType.slideTopBottom) { _uiScreenAnimationType = EnumUIScreenAnimationType.slideBottomTop;; } }