private void ChangePage(int selectedPage) { _activePage = selectedPage; if (ActivateUIOcclusion) { BehaviourList.ForEach(b => b.ResetUI(false)); } if (ActivateUIOcclusion) { ActivatePageWithAdjacents(); } StopTweensIfActive(); UIVirtualValueTweenerInfo pageTweenInfo = new UIVirtualValueTweenerInfo() { Callback = PageTweenUpdate, Duration = TransitionDuration, Ease = UITweeningEaseEnum.InOutCubic, From = PageScrollrect.horizontalNormalizedPosition, To = _headerSlideAmountPerPage * (_activePage - 1), IgnoreTimeScale = true }; _pageTweener = new UIVirtualValueTweener(pageTweenInfo); UIVirtualValueTweenController.Instance.StartTweener(_pageTweener); }
private void Init() { _pageTweener = null; _isDirty = false; PageButtonsHorLayoutGroup.SetLayoutHorizontal(); Canvas.ForceUpdateCanvases(); _headerWidth = HeaderSlider.GetComponent <RectTransform>().rect.width; var buttonRect = PageButtons[0].GetComponent <RectTransform>().rect; HandleIndicator.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, buttonRect.height); HandleIndicator.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, buttonRect.width); _totalTransitionCountBTPages = PageButtons.Count - 1; _headerSlideAmountPerPage = 1f / _totalTransitionCountBTPages; PageScrollrect.horizontal = true; PageScrollrect.onValueChanged.AddListener(OnScrollViewDragged); if (ActivateUIOcclusion) { BehaviourList.ForEach(b => b.ResetUI(false)); } PageButtons.ForEach(b => b.OnButtonPressedDown += OnPageButtonPressed); float slideAreaWidth = _headerWidth - buttonRect.width; HandleSlideArea.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, slideAreaWidth); }
protected override void Awake() { base.Awake(); _floatingButtonQueue = new Queue <UIFloatingButtonBehaviour>(); BehaviourList.ForEach(b => b.ResetUI(false)); }
protected override void Awake() { base.Awake(); if (DefaultOpenedPage >= BehaviourList.Count) { DefaultOpenedPage = 0; } BehaviourList.ForEach(b => b.ResetUI(false, MinSize)); BehaviourList[DefaultOpenedPage].ResetUI(true, 1 - (MinSize * (BehaviourList.Count - 1))); }