Guest User

ScrollSnapBase

a guest
May 8th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 19.17 KB | None | 0 0
  1. /// Credit BinaryX
  2. /// Sourced from - http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/page-2#post-1945602
  3. /// Updated by ddreaper - removed dependency on a custom ScrollRect script. Now implements drag interfaces and standard Scroll Rect.
  4.  
  5. using System;
  6. using UnityEngine.Events;
  7. using UnityEngine.EventSystems;
  8.  
  9. namespace UnityEngine.UI.Extensions
  10. {
  11.     public class ScrollSnapBase : MonoBehaviour, IBeginDragHandler, IDragHandler, IScrollSnap
  12.     {
  13.         internal Rect panelDimensions;
  14.         internal RectTransform _screensContainer;
  15.         internal bool _isVertical;
  16.  
  17.         internal int _screens = 1;
  18.  
  19.         internal float _scrollStartPosition;
  20.         internal float _childSize;
  21.         private float _childPos, _maskSize;
  22.         internal Vector2 _childAnchorPoint;
  23.         internal ScrollRect _scroll_rect;
  24.         internal Vector3 _lerp_target;
  25.         internal bool _lerp;
  26.         internal bool _pointerDown = false;
  27.         internal bool _settled = true;
  28.         internal Vector3 _startPosition = new Vector3();
  29.         [Tooltip("The currently active page")]
  30.         internal int _currentPage;
  31.         internal int _previousPage;
  32.         internal int _halfNoVisibleItems;
  33.         internal bool _moveStarted;
  34.         internal bool _isInfinate; // Is a UI Infinite scroller attached to the control
  35.         internal int _infiniteWindow; // The infinite window the control is in
  36.         internal float _infiniteOffset; // How much to offset a repositioning
  37.         private int _bottomItem, _topItem;
  38.  
  39.         [Serializable]
  40.         public class SelectionChangeStartEvent : UnityEvent { }
  41.         [Serializable]
  42.         public class SelectionPageChangedEvent : UnityEvent<int> { }
  43.         [Serializable]
  44.         public class SelectionChangeEndEvent : UnityEvent<int> { }
  45.  
  46.         [Tooltip("The screen / page to start the control on\n*Note, this is a 0 indexed array")]
  47.         [SerializeField]
  48.         public int StartingScreen = 0;
  49.  
  50.         [Tooltip("The distance between two pages based on page height, by default pages are next to each other")]
  51.         [SerializeField]
  52.         [Range(0, 8)]
  53.         public float PageStep = 1;
  54.  
  55.         [Tooltip("The gameobject that contains toggles which suggest pagination. (optional)")]
  56.         public GameObject Pagination;
  57.  
  58.         [Tooltip("Button to go to the previous page. (optional)")]
  59.         public GameObject PrevButton;
  60.  
  61.         [Tooltip("Button to go to the next page. (optional)")]
  62.         public GameObject NextButton;
  63.  
  64.         [Tooltip("Transition speed between pages. (optional)")]
  65.         public float transitionSpeed = 7.5f;
  66.  
  67.         [Tooltip("Hard Swipe forces to swiping to the next / previous page (optional)")]
  68.         public Boolean UseHardSwipe = false;
  69.  
  70.         [Tooltip("Fast Swipe makes swiping page next / previous (optional)")]
  71.         public Boolean UseFastSwipe = false;
  72.  
  73.         [Tooltip("Offset for how far a swipe has to travel to initiate a page change (optional)")]
  74.         public int FastSwipeThreshold = 100;
  75.  
  76.         [Tooltip("Speed at which the ScrollRect will keep scrolling before slowing down and stopping (optional)")]
  77.         public int SwipeVelocityThreshold = 100;
  78.  
  79.         [Tooltip("The visible bounds area, controls which items are visible/enabled. *Note Should use a RectMask. (optional)")]
  80.         public RectTransform MaskArea;
  81.  
  82.         [Tooltip("Pixel size to buffer around Mask Area. (optional)")]
  83.         public float MaskBuffer = 1;
  84.  
  85.         public int CurrentPage
  86.         {
  87.             get
  88.             {
  89.                 return _currentPage;
  90.             }
  91.  
  92.             internal set
  93.             {
  94.                 if (_isInfinate)
  95.                 {
  96.                     float infWindow = (float)value / (float)_screensContainer.childCount;          
  97.                     if (infWindow < 0)
  98.                     {
  99.                         _infiniteWindow = (int)(Math.Floor(infWindow));                        
  100.                     }else
  101.                     {  
  102.                         if (_screensContainer.childCount > 0)
  103.                             _infiniteWindow = value / _screensContainer.childCount;
  104.                         else
  105.                             _infiniteWindow = 0;
  106.                    
  107.                     }
  108.                
  109.                     _infiniteWindow = value < 0 ? (-_infiniteWindow) : _infiniteWindow;
  110.                     //Multiplying values by zero doesn't help, so start at Window 1
  111.                     //_infiniteWindow += 1;
  112.                     //Calculate the page within the child count range
  113.                     if (_screensContainer.childCount > 0)
  114.                     value = value % _screensContainer.childCount;
  115.                     else
  116.                         value = 0;
  117.                    
  118.                     if (value < 0)
  119.                     {
  120.                         value = _screensContainer.childCount + value;
  121.                     }
  122.                     else if (value > _screensContainer.childCount - 1)
  123.                     {
  124.                         value = value - _screensContainer.childCount;
  125.                     }
  126.                 }
  127.                 if ((value != _currentPage && value >= 0 && value < _screensContainer.childCount) || (value == 0 && _screensContainer.childCount == 0))
  128.                 {
  129.                     _previousPage = _currentPage;
  130.                     _currentPage = value;
  131.                     if (MaskArea) UpdateVisible();
  132.                     if (!_lerp) ScreenChange();
  133.                     OnCurrentScreenChange(_currentPage);
  134.                 }
  135.             }
  136.         }
  137.  
  138.         [Tooltip("By default the container will lerp to the start when enabled in the scene, this option overrides this and forces it to simply jump without lerping")]
  139.         public bool JumpOnEnable = false;
  140.  
  141.         [Tooltip("By default the container will return to the original starting page when enabled, this option overrides this behaviour and stays on the current selection")]
  142.         public bool RestartOnEnable = false;
  143.  
  144.         [Tooltip("(Experimental)\nBy default, child array objects will use the parent transform\nHowever you can disable this for some interesting effects")]
  145.         public bool UseParentTransform = true;
  146.  
  147.         [Tooltip("Scroll Snap children. (optional)\nEither place objects in the scene as children OR\nPrefabs in this array, NOT BOTH")]
  148.         public GameObject[] ChildObjects;
  149.  
  150.         [SerializeField]
  151.         [Tooltip("Event fires when a user starts to change the selection")]
  152.         private SelectionChangeStartEvent m_OnSelectionChangeStartEvent = new SelectionChangeStartEvent();
  153.         public SelectionChangeStartEvent OnSelectionChangeStartEvent { get { return m_OnSelectionChangeStartEvent; } set { m_OnSelectionChangeStartEvent = value; } }
  154.  
  155.         [SerializeField]
  156.         [Tooltip("Event fires as the page changes, while dragging or jumping")]
  157.         private SelectionPageChangedEvent m_OnSelectionPageChangedEvent = new SelectionPageChangedEvent();
  158.         public SelectionPageChangedEvent OnSelectionPageChangedEvent { get { return m_OnSelectionPageChangedEvent; } set { m_OnSelectionPageChangedEvent = value; } }
  159.  
  160.         [SerializeField]
  161.         [Tooltip("Event fires when the page settles after a user has dragged")]
  162.         private SelectionChangeEndEvent m_OnSelectionChangeEndEvent = new SelectionChangeEndEvent();
  163.         public SelectionChangeEndEvent OnSelectionChangeEndEvent { get { return m_OnSelectionChangeEndEvent; } set { m_OnSelectionChangeEndEvent = value; } }
  164.  
  165.         // Use this for initialization
  166.         void Awake()
  167.         {
  168.             if (_scroll_rect == null)
  169.             {
  170.                 _scroll_rect = gameObject.GetComponent<ScrollRect>();
  171.             }
  172.             if (_scroll_rect.horizontalScrollbar && _scroll_rect.horizontal)
  173.             {
  174.                 var hscroll = _scroll_rect.horizontalScrollbar.gameObject.AddComponent<ScrollSnapScrollbarHelper>();
  175.                 hscroll.ss = this;
  176.             }
  177.             if (_scroll_rect.verticalScrollbar && _scroll_rect.vertical)
  178.             {
  179.                 var vscroll = _scroll_rect.verticalScrollbar.gameObject.AddComponent<ScrollSnapScrollbarHelper>();
  180.                 vscroll.ss = this;
  181.             }
  182.             panelDimensions = gameObject.GetComponent<RectTransform>().rect;
  183.  
  184.             if (StartingScreen < 0)
  185.             {
  186.                 StartingScreen = 0;
  187.             }
  188.  
  189.             _screensContainer = _scroll_rect.content;
  190.  
  191.             InitialiseChildObjects();
  192.  
  193.             if (NextButton)
  194.                 NextButton.GetComponent<Button>().onClick.AddListener(() => { NextScreen(); });
  195.  
  196.             if (PrevButton)
  197.                 PrevButton.GetComponent<Button>().onClick.AddListener(() => { PreviousScreen(); });
  198.  
  199.             _isInfinate = GetComponent<UI_InfiniteScroll>() != null;
  200.         }
  201.  
  202.         internal void InitialiseChildObjects()
  203.         {
  204.             if (ChildObjects != null && ChildObjects.Length > 0)
  205.             {
  206.                 if (_screensContainer.transform.childCount > 0)
  207.                 {
  208.                     Debug.LogError("ScrollRect Content has children, this is not supported when using managed Child Objects\n Either remove the ScrollRect Content children or clear the ChildObjects array");
  209.                     return;
  210.                 }
  211.  
  212.                 InitialiseChildObjectsFromArray();
  213.             }
  214.             else
  215.             {
  216.                 InitialiseChildObjectsFromScene();
  217.             }
  218.         }
  219.  
  220.         internal void InitialiseChildObjectsFromScene()
  221.         {
  222.             int childCount = _screensContainer.childCount;
  223.             ChildObjects = new GameObject[childCount];
  224.             for (int i = 0; i < childCount; i++)
  225.             {
  226.                 ChildObjects[i] = _screensContainer.transform.GetChild(i).gameObject;
  227.                 if (MaskArea && ChildObjects[i].activeSelf)
  228.                 {
  229.                     ChildObjects[i].SetActive(false);
  230.                 }
  231.             }
  232.         }
  233.  
  234.         internal void InitialiseChildObjectsFromArray()
  235.         {
  236.             int childCount = ChildObjects.Length;
  237.             RectTransform childRect;
  238.             GameObject child;
  239.             for (int i = 0; i < childCount; i++)
  240.             {
  241.                 child = GameObject.Instantiate(ChildObjects[i]);
  242.                 //Optionally, use original GO transform when initialising, by default will use parent RectTransform position/rotation
  243.                 if (UseParentTransform)
  244.                 {
  245.                     childRect = child.GetComponent<RectTransform>();
  246.                     childRect.rotation = _screensContainer.rotation;
  247.                     childRect.localScale = _screensContainer.localScale;
  248.                     childRect.position = _screensContainer.position;
  249.                 }
  250.  
  251.                 child.transform.SetParent(_screensContainer.transform);
  252.                 ChildObjects[i] = child;
  253.                 if (MaskArea && ChildObjects[i].activeSelf)
  254.                 {
  255.                     ChildObjects[i].SetActive(false);
  256.                 }
  257.             }
  258.         }
  259.  
  260.         internal void UpdateVisible()
  261.         {
  262.             //If there are no objects in the scene or a mask, exit
  263.             if (!MaskArea || ChildObjects == null || ChildObjects.Length < 1 || _screensContainer.childCount < 1)
  264.             {
  265.                 return;
  266.             }
  267.  
  268.             _maskSize = _isVertical ? MaskArea.rect.height : MaskArea.rect.width;
  269.             _halfNoVisibleItems = (int)Math.Round(_maskSize / (_childSize * MaskBuffer), MidpointRounding.AwayFromZero) / 2;
  270.             _bottomItem = _topItem = 0;
  271.             //work out how many items below the current page can be visible
  272.             for (int i = _halfNoVisibleItems + 1; i > 0; i--)
  273.             {
  274.                 _bottomItem = _currentPage - i < 0 ? 0 : i;
  275.                 if (_bottomItem > 0) break;
  276.             }
  277.  
  278.             //work out how many items above the current page can be visible
  279.             for (int i = _halfNoVisibleItems + 1; i > 0; i--)
  280.             {
  281.                 _topItem = _screensContainer.childCount - _currentPage - i < 0 ? 0 : i;
  282.                 if (_topItem > 0) break;
  283.             }
  284.  
  285.             //Set the active items active
  286.             for (int i = CurrentPage - _bottomItem; i < CurrentPage + _topItem; i++)
  287.             {
  288.                 try
  289.                 {
  290.                     ChildObjects[i].SetActive(true);
  291.                 }
  292.                 catch
  293.                 {
  294.                     Debug.Log("Failed to setactive child [" + i + "]");
  295.                 }
  296.             }
  297.  
  298.             //Deactivate items out of visibility at the bottom of the ScrollRect Mask (only on scroll)
  299.             if (_currentPage > _halfNoVisibleItems) ChildObjects[CurrentPage - _bottomItem].SetActive(false);
  300.             //Deactivate items out of visibility at the top of the ScrollRect Mask (only on scroll)
  301.             if (_screensContainer.childCount - _currentPage > _topItem) ChildObjects[CurrentPage + _topItem].SetActive(false);
  302.         }
  303.  
  304.         //Function for switching screens with buttons
  305.         public void NextScreen()
  306.         {
  307.             if (_currentPage < _screens - 1 || _isInfinate)
  308.             {
  309.                 if (!_lerp) StartScreenChange();
  310.  
  311.                 _lerp = true;
  312.                 CurrentPage = _currentPage + 1;
  313.                 GetPositionforPage(_currentPage, ref _lerp_target);
  314.                 ScreenChange();
  315.             }
  316.  
  317.         }
  318.  
  319.         //Function for switching screens with buttons
  320.         public void PreviousScreen()
  321.         {
  322.             if (_currentPage > 0 || _isInfinate)
  323.             {
  324.                 if (!_lerp) StartScreenChange();
  325.  
  326.                 _lerp = true;
  327.                 CurrentPage = _currentPage - 1;
  328.                 GetPositionforPage(_currentPage, ref _lerp_target);
  329.                 ScreenChange();
  330.             }
  331.         }
  332.  
  333.         /// <summary>
  334.         /// Function for switching to a specific screen
  335.         /// *Note, this is based on a 0 starting index - 0 to x
  336.         /// </summary>
  337.         /// <param name="screenIndex">0 starting index of page to jump to</param>
  338.         public void GoToScreen(int screenIndex)
  339.         {
  340.             if (screenIndex <= _screens - 1 && screenIndex >= 0)
  341.             {
  342.                 if (!_lerp) StartScreenChange();
  343.  
  344.                 _lerp = true;
  345.                 CurrentPage = screenIndex;
  346.                 GetPositionforPage(_currentPage, ref _lerp_target);
  347.                 ScreenChange();
  348.             }
  349.         }
  350.  
  351.         /// <summary>
  352.         /// Gets the closest page for the current Scroll Rect container position
  353.         /// </summary>
  354.         /// <param name="pos">Position to test, normally the Scroll Rect container Local position</param>
  355.         /// <returns>Closest Page number (zero indexed array value)</returns>
  356.         internal int GetPageforPosition(Vector3 pos)
  357.         {
  358.             return _isVertical ?
  359.                 (int)Math.Round((_scrollStartPosition - pos.y) / _childSize) :
  360.                 (int)Math.Round((_scrollStartPosition - pos.x) / _childSize);
  361.         }
  362.  
  363.         /// <summary>
  364.         /// Validates if the current Scroll Rect container position is within the bounds for a page
  365.         /// </summary>
  366.         /// <param name="pos">Position to test, normally the Scroll Rect container Local position</param>
  367.         /// <returns>True / False, is the position in the bounds of a page</returns>
  368.         internal bool IsRectSettledOnaPage(Vector3 pos)
  369.         {
  370.             return _isVertical ?
  371.                 -((pos.y - _scrollStartPosition) / _childSize) == -(int)Math.Round((pos.y - _scrollStartPosition) / _childSize) :
  372.                 -((pos.x - _scrollStartPosition) / _childSize) == -(int)Math.Round((pos.x - _scrollStartPosition) / _childSize);
  373.         }
  374.  
  375.         /// <summary>
  376.         /// Returns the local position for a child page based on the required page number
  377.         /// </summary>
  378.         /// <param name="page">Page that the position is required for (Zero indexed array value)</param>
  379.         /// <param name="target">Outputs the local position for the selected page</param>
  380.         internal void GetPositionforPage(int page, ref Vector3 target)
  381.         {
  382.             _childPos = -_childSize * page;
  383.             if (_isVertical)
  384.             {
  385.                 _infiniteOffset = _screensContainer.localPosition.y < 0 ? -_screensContainer.sizeDelta.y * _infiniteWindow : _screensContainer.sizeDelta.y * _infiniteWindow;
  386.                 target.y = _childPos + _scrollStartPosition + _infiniteOffset;
  387.             }
  388.             else
  389.             {
  390.                 _infiniteOffset = _screensContainer.localPosition.x < 0 ? -_screensContainer.sizeDelta.x * _infiniteWindow : _screensContainer.sizeDelta.x * _infiniteWindow;
  391.                 _infiniteOffset = _infiniteOffset == 0 ? 0 : _infiniteOffset < 0 ? _infiniteOffset - _childSize * _infiniteWindow : _infiniteOffset + _childSize * _infiniteWindow;
  392.                 target.x = _childPos + _scrollStartPosition + _infiniteOffset;
  393.             }
  394.         }
  395.  
  396.         /// <summary>
  397.         /// Updates the _Lerp target to the closest page and updates the pagination bullets.  Each control's update loop will then handle the move.
  398.         /// </summary>
  399.         internal void ScrollToClosestElement()
  400.         {
  401.             _lerp = true;
  402.             CurrentPage = GetPageforPosition(_screensContainer.localPosition);
  403.             GetPositionforPage(_currentPage, ref _lerp_target);
  404.             OnCurrentScreenChange(_currentPage);
  405.         }
  406.  
  407.         /// <summary>
  408.         /// notifies pagination indicator and navigation buttons of a screen change
  409.         /// </summary>
  410.         internal void OnCurrentScreenChange(int currentScreen)
  411.         {
  412.             ChangeBulletsInfo(currentScreen);
  413.             ToggleNavigationButtons(currentScreen);
  414.         }
  415.  
  416.         /// <summary>
  417.         /// changes the bullets on the bottom of the page - pagination
  418.         /// </summary>
  419.         /// <param name="targetScreen"></param>
  420.         private void ChangeBulletsInfo(int targetScreen)
  421.         {
  422.             if (Pagination)
  423.                 for (int i = 0; i < Pagination.transform.childCount; i++)
  424.                 {
  425.                     Pagination.transform.GetChild(i).GetComponent<Toggle>().isOn = (targetScreen == i)
  426.                         ? true
  427.                         : false;
  428.                 }
  429.         }
  430.  
  431.         /// <summary>
  432.         /// disables the page navigation buttons when at the first or last screen
  433.         /// </summary>
  434.         /// <param name="targetScreen"></param>
  435.         private void ToggleNavigationButtons(int targetScreen)
  436.         {
  437.             //If this is using an Infinite Scroll, then don't disable
  438.             if (!_isInfinate)
  439.             {
  440.                 if (PrevButton)
  441.                 {
  442.                     PrevButton.GetComponent<Button>().interactable = targetScreen > 0;
  443.                 }
  444.  
  445.                 if (NextButton)
  446.                 {
  447.                     NextButton.GetComponent<Button>().interactable = targetScreen < _screensContainer.transform.childCount - 1;
  448.                 }
  449.             }
  450.         }
  451.  
  452.         private void OnValidate()
  453.         {
  454.             if (_scroll_rect == null)
  455.             {
  456.                 _scroll_rect = GetComponent<ScrollRect>();
  457.             }
  458.             if (!_scroll_rect.horizontal && !_scroll_rect.vertical)
  459.             {
  460.                 Debug.LogError("ScrollRect has to have a direction, please select either Horizontal OR Vertical with the appropriate control.");
  461.             }
  462.             if (_scroll_rect.horizontal && _scroll_rect.vertical)
  463.             {
  464.                 Debug.LogError("ScrollRect has to be unidirectional, only use either Horizontal or Vertical on the ScrollRect, NOT both.");
  465.             }
  466.  
  467.             var children = gameObject.GetComponent<ScrollRect>().content.childCount;
  468.             if (children != 0 || ChildObjects != null)
  469.             {
  470.                 var childCount = ChildObjects == null || ChildObjects.Length == 0 ? children : ChildObjects.Length;
  471.                 if (StartingScreen > childCount - 1)
  472.                 {
  473.                     StartingScreen = childCount - 1;
  474.                 }
  475.  
  476.                 if (StartingScreen < 0)
  477.                 {
  478.                     StartingScreen = 0;
  479.                 }
  480.             }
  481.  
  482.             if (MaskBuffer <= 0)
  483.             {
  484.                 MaskBuffer = 1;
  485.             }
  486.  
  487.             if (PageStep < 0)
  488.             {
  489.                 PageStep = 0;
  490.             }
  491.  
  492.             if (PageStep > 8)
  493.             {
  494.                 PageStep = 9;
  495.             }
  496.         }
  497.  
  498.         /// <summary>
  499.         /// Event fires when the user starts to change the page, either via swipe or button.
  500.         /// </summary>
  501.         public void StartScreenChange()
  502.         {
  503.             if (!_moveStarted)
  504.             {
  505.                 _moveStarted = true;
  506.                 OnSelectionChangeStartEvent.Invoke();
  507.             }
  508.         }
  509.  
  510.         /// <summary>
  511.         /// Event fires when the currently viewed page changes, also updates while the scroll is moving
  512.         /// </summary>
  513.         internal void ScreenChange()
  514.         {
  515.             OnSelectionPageChangedEvent.Invoke(_currentPage);
  516.         }
  517.  
  518.         /// <summary>
  519.         /// Event fires when control settles on a page, outputs the new page number
  520.         /// </summary>
  521.         internal void EndScreenChange()
  522.         {
  523.             OnSelectionChangeEndEvent.Invoke(_currentPage);
  524.             _settled = true;
  525.             _moveStarted = false;
  526.         }
  527.  
  528.         /// <summary>
  529.         /// Returns the Transform of the Current page
  530.         /// </summary>
  531.         /// <returns>Currently selected Page Transform</returns>
  532.         public Transform CurrentPageObject()
  533.         {
  534.             return _screensContainer.GetChild(CurrentPage);
  535.         }
  536.  
  537.         /// <summary>
  538.         /// Returns the Transform of the Current page in an out parameter for performance
  539.         /// </summary>
  540.         /// <param name="returnObject">Currently selected Page Transform</param>
  541.         public void CurrentPageObject(out Transform returnObject)
  542.         {
  543.             returnObject = _screensContainer.GetChild(CurrentPage);
  544.         }
  545.  
  546.         #region Drag Interfaces
  547.         /// <summary>
  548.         /// Touch screen to start swiping
  549.         /// </summary>
  550.         /// <param name="eventData"></param>
  551.         public void OnBeginDrag(PointerEventData eventData)
  552.         {
  553.             _pointerDown = true;
  554.             _settled = false;
  555.             StartScreenChange();
  556.             _startPosition = _screensContainer.localPosition;
  557.         }
  558.  
  559.         /// <summary>
  560.         /// While dragging do
  561.         /// </summary>
  562.         /// <param name="eventData"></param>
  563.         public void OnDrag(PointerEventData eventData)
  564.         {
  565.             _lerp = false;
  566.         }
  567.  
  568.         #endregion
  569.  
  570.         #region IScrollSnap Interface
  571.  
  572.         /// <summary>
  573.         /// Added to provide a uniform interface for the ScrollBarHelper
  574.         /// </summary>
  575.         int IScrollSnap.CurrentPage()
  576.         {
  577.             return CurrentPage = GetPageforPosition(_screensContainer.localPosition);
  578.         }
  579.  
  580.         /// <summary>
  581.         /// Added to provide a uniform interface for the ScrollBarHelper
  582.         /// </summary>
  583.         public void SetLerp(bool value)
  584.         {
  585.             _lerp = value;
  586.         }
  587.  
  588.         /// <summary>
  589.         /// Added to provide a uniform interface for the ScrollBarHelper
  590.         /// </summary>
  591.         public void ChangePage(int page)
  592.         {
  593.             GoToScreen(page);
  594.         }
  595.         #endregion
  596.     }
  597. }
Advertisement
Add Comment
Please, Sign In to add comment