PagedRect
1.26
|
Classes | |
class | PageChangedEventType |
Public Types | |
enum | eAnimationType { eAnimationType.None, eAnimationType.SlideHorizontal, eAnimationType.SlideVertical, eAnimationType.Fade } |
enum | eDirection { eDirection.Left, eDirection.Right } |
enum | DeltaDirection { DeltaDirection.None, DeltaDirection.Next, DeltaDirection.Previous } |
Public Member Functions | |||
void | OnEndDrag (PointerEventData data) | ||
Called whenever the user stops dragging More... | |||
void | UpgradeLayoutGroupIfNecessary () | ||
void | AddPage (Page page) | ||
Add a new page to this PagedRect - this Page should already have been instantiated. More... | |||
Page | AddPageUsingTemplate () | ||
Add a new page to this PagedRect - this Page will be instantiated and returned by this function. You can then customize it as required. More... | |||
void | RemovePage (Page page, bool destroyPageObject=false) | ||
Remove a Page from this PagedRect, and optionally destroy it More... | |||
void | RemovePage (int pageNumber, bool destroyPageObject=false) | ||
void | RemoveAllPages (bool destroyPageObjects=false) | ||
void | SetEditorSelectedPage (int page) | ||
Used by the Editor to keep track of the selected page in edit mode More... | |||
Page | GetPageByNumber (int pageNumber, bool secondAttempt=false, bool allowNulls=false) | ||
Page | GetCurrentPage () | ||
int | GetPageNumber (Page page) | ||
void | UpdatePagination () | ||
Updates the page buttons More... | |||
void | ScrollBarValueChanged () | ||
void | CenterScrollRectOnCurrentPage (bool initial=false) | ||
float | GetPageOffset (Page page) | ||
float | GetPageOffset_PagePreviews (Page page) | ||
void | SetShowFirstAndLastButtons (bool show) | ||
Show or hide the First and Last Buttons More... | |||
void | SetShowPreviousAndNextButtons (bool show) | ||
Show or Hide the Previous and Next Buttons More... | |||
void | SetAnimationSpeed (float animationSpeed) | ||
Set the animation speed for this PagedRect More... | |||
void | SetAnimationType (string animationType) | ||
Set the Animation type of this PagedRect More... | |||
void | SetDelayBetweenPages (float delay) | ||
Set the delay between pages (when automatically scrolling through pages) More... | |||
void | SetLoopEndlessly (bool loop) | ||
Enable or Disable Endless Looping More... | |||
void | SetAutomaticallyMoveToNextPage (bool move) | ||
Enable or Disable automatically moving to the next page More... | |||
void | SetShowPageNumbersOnButtons (bool show) | ||
Show or Hide page numbers on Buttons More... | |||
void | SetShowPageTitlesOnButtons (bool show) | ||
Show or Hide page titles on Buttons (page titles are sourced from Page.PageTitle) More... | |||
void | SetMaximumNumberOfButtonsToShow (int maxNumber) | ||
Set the maximum number of buttons to show at once More... | |||
void | SetMaximumNumberOfButtonsToShow (float maxNumber) | ||
Float version of SetMaximumNumberOfButtonsToShow so we can accept input from a UI slider. More... | |||
void | SetUseKeyboardInput (bool useInput) | ||
Enable or disable keyboard input More... | |||
void | SetUseSwipeInput (bool useInput) | ||
Enable or disable Swipe input Please be advised that if this PagedRect is using a ScrollRect, this value will be ignored More... | |||
void | SetUseScrollWheelInput (bool useInput) | ||
Enable or disable scroll wheel input More... | |||
void | SetOnlyUseScrollWheelInputOnlyWhenMouseIsOver (bool onlyWhenMouseIsOver) | ||
void | SetHighlightWhenMouseIsOver (bool highlight) | ||
void | SetSwipeDeltaThreshold (float threshold) | ||
virtual void | SetCurrentPage (Page newPage, bool initial=false) | ||
Set the Current Page of this PagedRect. More... | |||
virtual void | SetCurrentPage (int newPage) | ||
virtual void | SetCurrentPage (int newPage, bool initial) | ||
Set the Current Page of this PagedRect (by its position in the hierarchy) More... | |||
virtual void | NextPage () | ||
Show the next enabled Page (if there is one) More... | |||
virtual void | PreviousPage () | ||
Show the previous enabled Page (if there is one) More... | |||
virtual void | ShowFirstPage () | ||
Show the first enabled page More... | |||
virtual void | ShowLastPage () | ||
Show the last enabled page More... | |||
System.Collections.IEnumerator | DelayedCall (float delay, Action call) | ||
Call a function after the specified delay. More... | |||
void | UpdateDisplay () | ||
Shows/Hides pagination and buttons as required More... | |||
void | UpdatePages (bool force=false, bool forceRenewPageNumbers=false) | ||
Call this function at any time to update the page collection.
| |||
void | ViewportDimensionsChanged () | ||
Protected Member Functions | |
void | PageEnterAnimation (Page page, eDirection direction, bool initial=false) |
Trigger a Page Show animation More... | |
void | PageExitAnimation (Page page, eDirection direction) |
Trigger a Page Exit animation More... | |
void | ScrollToClosestPage () |
DeltaDirection | GetDragDeltaDirection (PointerEventData data) |
bool | HandleDragDelta (PointerEventData data) |
bool | HandleDragDelta (DeltaDirection deltaDirection) |
void | ShowHighlight () |
void | ClearHighlight () |
void | OnMouseOver () |
void | OnMouseExit () |
int | GetPagePosition (int PageNumber) |
Return the position of the given page number (as pages are moved around by Infinite Scrolling) More... | |
int | GetPagePosition (Page page) |
void | ScrollRectValueChanged (Vector2 newPosition) |
Called whenever the ScrollRect's position changes More... | |
void | SetScrollRectPosition () |
IEnumerator | ScrollToDesiredPosition () |
int | GetClosestPageNumberToScrollRectCenter () |
Dictionary< int, float > | GetPageDistancesFromScrollRectCenter () |
float | GetDesiredScrollRectOffset () |
void | RecalculateDesiredPageSizes () |
float | GetDesiredScrollRectOffset_PagePreviews () |
void | HandlePagePreviewPreferredSizes () |
void | HandlePagePreviewScaling () |
Protected Attributes | |
eAnimationType | previousAnimationTypeValue |
float | _timeSinceLastPage = 0f |
bool | mouseIsOverPagedRect = false |
List< Page > | _pages = new List<Page>() |
This is used to check for changes to the Page collection and avoid updating except where necessary If we do update unnecessarily, the scene gets marked as dirty without it actually needing to be More... | |
Vector2 | _ScrollRectPosition = new Vector2() |
bool | firstPageSet = false |
List< KeyValuePair< double, Action > > | delayedEditorActions = new List<KeyValuePair<double, Action>>() |
Properties | |
bool | isDirty [get, set] |
int | CurrentPage [get, protected set] |
int | NumberOfPages [get] |
MobileInput | MobileInput [get] |
ScrollWheelInput | ScrollWheelInput [get] |
UnityEngine.UI.Image | imageComponent [get] |
UnityEngine.UI.HorizontalOrVerticalLayoutGroup | layoutGroup [get] |
bool | UsingScrollRect [get] |
If this is true, this PagedRect has detected that it is using a ScrollRect, and some behaviour will work differently (e.g. MobileInput) More... | |
|
strong |
|
strong |
|
strong |
void UI.Pagination.PagedRect.AddPage | ( | Page | page | ) |
Page UI.Pagination.PagedRect.AddPageUsingTemplate | ( | ) |
void UI.Pagination.PagedRect.CenterScrollRectOnCurrentPage | ( | bool | initial = false | ) |
|
protected |
System.Collections.IEnumerator UI.Pagination.PagedRect.DelayedCall | ( | float | delay, |
Action | call | ||
) |
Call a function after the specified delay.
delay | |
call |
|
protected |
Page UI.Pagination.PagedRect.GetCurrentPage | ( | ) |
|
protected |
|
protected |
|
protected |
Page UI.Pagination.PagedRect.GetPageByNumber | ( | int | pageNumber, |
bool | secondAttempt = false , |
||
bool | allowNulls = false |
||
) |
|
protected |
int UI.Pagination.PagedRect.GetPageNumber | ( | Page | page | ) |
float UI.Pagination.PagedRect.GetPageOffset | ( | Page | page | ) |
float UI.Pagination.PagedRect.GetPageOffset_PagePreviews | ( | Page | page | ) |
|
protected |
Return the position of the given page number (as pages are moved around by Infinite Scrolling)
PageNumber |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
virtual |
Show the next enabled Page (if there is one)
void UI.Pagination.PagedRect.OnEndDrag | ( | PointerEventData | data | ) |
Called whenever the user stops dragging
data |
|
protected |
|
protected |
|
protected |
Trigger a Page Show animation
page | |
direction | |
initial |
|
protected |
Trigger a Page Exit animation
page | |
direction |
|
virtual |
Show the previous enabled Page (if there is one)
|
protected |
void UI.Pagination.PagedRect.RemoveAllPages | ( | bool | destroyPageObjects = false | ) |
void UI.Pagination.PagedRect.RemovePage | ( | Page | page, |
bool | destroyPageObject = false |
||
) |
void UI.Pagination.PagedRect.RemovePage | ( | int | pageNumber, |
bool | destroyPageObject = false |
||
) |
void UI.Pagination.PagedRect.ScrollBarValueChanged | ( | ) |
|
protected |
Called whenever the ScrollRect's position changes
newPosition |
|
protected |
|
protected |
void UI.Pagination.PagedRect.SetAnimationSpeed | ( | float | animationSpeed | ) |
Set the animation speed for this PagedRect
animationSpeed |
void UI.Pagination.PagedRect.SetAnimationType | ( | string | animationType | ) |
Set the Animation type of this PagedRect
animationType |
void UI.Pagination.PagedRect.SetAutomaticallyMoveToNextPage | ( | bool | move | ) |
Enable or Disable automatically moving to the next page
move |
|
virtual |
|
virtual |
|
virtual |
void UI.Pagination.PagedRect.SetDelayBetweenPages | ( | float | delay | ) |
Set the delay between pages (when automatically scrolling through pages)
delay |
void UI.Pagination.PagedRect.SetEditorSelectedPage | ( | int | page | ) |
Used by the Editor to keep track of the selected page in edit mode
page |
void UI.Pagination.PagedRect.SetHighlightWhenMouseIsOver | ( | bool | highlight | ) |
void UI.Pagination.PagedRect.SetLoopEndlessly | ( | bool | loop | ) |
Enable or Disable Endless Looping
loop |
void UI.Pagination.PagedRect.SetMaximumNumberOfButtonsToShow | ( | int | maxNumber | ) |
Set the maximum number of buttons to show at once
maxNumber |
void UI.Pagination.PagedRect.SetMaximumNumberOfButtonsToShow | ( | float | maxNumber | ) |
Float version of SetMaximumNumberOfButtonsToShow so we can accept input from a UI slider.
maxNumber |
void UI.Pagination.PagedRect.SetOnlyUseScrollWheelInputOnlyWhenMouseIsOver | ( | bool | onlyWhenMouseIsOver | ) |
|
protected |
void UI.Pagination.PagedRect.SetShowFirstAndLastButtons | ( | bool | show | ) |
Show or hide the First and Last Buttons
show |
void UI.Pagination.PagedRect.SetShowPageNumbersOnButtons | ( | bool | show | ) |
Show or Hide page numbers on Buttons
show |
void UI.Pagination.PagedRect.SetShowPageTitlesOnButtons | ( | bool | show | ) |
Show or Hide page titles on Buttons (page titles are sourced from Page.PageTitle)
show |
void UI.Pagination.PagedRect.SetShowPreviousAndNextButtons | ( | bool | show | ) |
Show or Hide the Previous and Next Buttons
show |
void UI.Pagination.PagedRect.SetSwipeDeltaThreshold | ( | float | threshold | ) |
void UI.Pagination.PagedRect.SetUseKeyboardInput | ( | bool | useInput | ) |
Enable or disable keyboard input
useInput |
void UI.Pagination.PagedRect.SetUseScrollWheelInput | ( | bool | useInput | ) |
Enable or disable scroll wheel input
useInput |
void UI.Pagination.PagedRect.SetUseSwipeInput | ( | bool | useInput | ) |
Enable or disable Swipe input Please be advised that if this PagedRect is using a ScrollRect, this value will be ignored
useInput |
|
virtual |
Show the first enabled page
|
protected |
|
virtual |
Show the last enabled page
void UI.Pagination.PagedRect.UpdateDisplay | ( | ) |
Shows/Hides pagination and buttons as required
void UI.Pagination.PagedRect.UpdatePages | ( | bool | force = false , |
bool | forceRenewPageNumbers = false |
||
) |
Call this function at any time to update the page collection.
forceRenewPageNumbers | If this is set to true, then all pages will be given new page numbers based on their order - if not, only pages which have not yet been issued a pageNumber will be granted one. The reasoning behind this is that, if this PagedRect is using Infinite Scrolling, then the pages themselves will be reordered as you scroll through them, but we still want to preserve the page numbers (in the past the order was always the page number). |
void UI.Pagination.PagedRect.UpdatePagination | ( | ) |
Updates the page buttons
void UI.Pagination.PagedRect.UpgradeLayoutGroupIfNecessary | ( | ) |
void UI.Pagination.PagedRect.ViewportDimensionsChanged | ( | ) |
This is used to check for changes to the Page collection and avoid updating except where necessary If we do update unnecessarily, the scene gets marked as dirty without it actually needing to be
|
protected |
|
protected |
RuntimeAnimatorController UI.Pagination.PagedRect.AnimationControllerTemplate |
float UI.Pagination.PagedRect.AnimationSpeed = 1.0f |
eAnimationType UI.Pagination.PagedRect.AnimationType = eAnimationType.SlideHorizontal |
bool UI.Pagination.PagedRect.AutoDiscoverPages = true |
bool UI.Pagination.PagedRect.AutomaticallyMoveToNextPage = false |
PaginationButton UI.Pagination.PagedRect.Button_FirstPage |
PaginationButton UI.Pagination.PagedRect.Button_LastPage |
PaginationButton UI.Pagination.PagedRect.Button_NextPage |
PaginationButton UI.Pagination.PagedRect.Button_PreviousPage |
PaginationButton UI.Pagination.PagedRect.ButtonTemplate_CurrentPage |
PaginationButton UI.Pagination.PagedRect.ButtonTemplate_DisabledPage |
PaginationButton UI.Pagination.PagedRect.ButtonTemplate_OtherPages |
int UI.Pagination.PagedRect.DefaultPage |
float UI.Pagination.PagedRect.DelayBetweenPages = 5f |
|
protected |
int UI.Pagination.PagedRect.editorSelectedPage = 1 |
KeyCode UI.Pagination.PagedRect.FirstPageKey = KeyCode.Home |
|
protected |
Color UI.Pagination.PagedRect.HighlightColor = new Color(0.9f, 0.9f, 0.9f) |
bool UI.Pagination.PagedRect.HighlightWhenMouseIsOver = false |
KeyCode UI.Pagination.PagedRect.LastPageKey = KeyCode.End |
bool UI.Pagination.PagedRect.LockOneToOneScaleRatio = true |
bool UI.Pagination.PagedRect.LoopEndlessly = true |
bool UI.Pagination.PagedRect.LoopSeamlessly = false |
int UI.Pagination.PagedRect.MaximumNumberOfButtonsToShow = 15 |
|
protected |
Page UI.Pagination.PagedRect.NewPageTemplate |
KeyCode UI.Pagination.PagedRect.NextPageKey = KeyCode.RightArrow |
Color UI.Pagination.PagedRect.NormalColor = new Color(1f, 1f, 1f) |
bool UI.Pagination.PagedRect.OnlyUseScrollWheelInputWhenMouseIsOver = true |
PageChangedEventType UI.Pagination.PagedRect.PageChangedEvent = new PageChangedEventType() |
Color UI.Pagination.PagedRect.PagePreviewOverlayHoverColor |
Sprite UI.Pagination.PagedRect.PagePreviewOverlayImage |
Color UI.Pagination.PagedRect.PagePreviewOverlayNormalColor |
float UI.Pagination.PagedRect.PagePreviewOverlayScaleOverride = 1f |
float UI.Pagination.PagedRect.PagePreviewScale = 0.25f |
GameObject UI.Pagination.PagedRect.Pagination |
|
protected |
KeyCode UI.Pagination.PagedRect.PreviousPageKey = KeyCode.LeftArrow |
PagedRect_ScrollRect UI.Pagination.PagedRect.ScrollRect |
GameObject UI.Pagination.PagedRect.ScrollRectViewport |
bool UI.Pagination.PagedRect.ShowButtonTemplatesInEditor = true |
bool UI.Pagination.PagedRect.ShowFirstAndLastButtons = true |
bool UI.Pagination.PagedRect.ShowNumbersOnButtons = true |
bool UI.Pagination.PagedRect.ShowPageButtons = true |
bool UI.Pagination.PagedRect.ShowPagePreviews = false |
bool UI.Pagination.PagedRect.ShowPageTitlesOnButtons = false |
bool UI.Pagination.PagedRect.ShowPagination = true |
bool UI.Pagination.PagedRect.ShowPreviousAndNextButtons = true |
bool UI.Pagination.PagedRect.ShowScrollBar = false |
RectTransform UI.Pagination.PagedRect.sizingTransform |
float UI.Pagination.PagedRect.SpaceBetweenPages = 0f |
float UI.Pagination.PagedRect.SwipeDeltaThreshold = .1f |
bool UI.Pagination.PagedRect.UseKeyboardInput = false |
bool UI.Pagination.PagedRect.UseScrollWheelInput = false |
bool UI.Pagination.PagedRect.UseSwipeInput = true |
GameObject UI.Pagination.PagedRect.Viewport |
|
getprotected set |
|
getprotected |
|
getset |
|
getprotected |
|
get |
|
get |
|
get |
|
get |
If this is true, this PagedRect has detected that it is using a ScrollRect, and some behaviour will work differently (e.g. MobileInput)