C# Класс UIScrollView, TheUnseen

Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
contentPivot UIWidget.Pivot
customMovement Vector2
disableDragIfFits bool
dragEffect DragEffect
horizontalScrollBar UIProgressBar,
iOSDragEmulation bool
list BetterList
momentumAmount float
movement Movement,
onDragFinished OnDragFinished
restrictWithinPanel bool
scrollWheelFactor float
showScrollBars ShowCondition
smoothDragStart bool
verticalScrollBar UIProgressBar,

Открытые методы

Метод Описание
DisableSpring ( ) : void

Disable the spring movement.

Drag ( ) : void

Drag the object along the plane.

MoveAbsolute ( Vector3 absolute ) : void

Move the scroll view by the specified amount.

MoveRelative ( Vector3 relative ) : void

Move the scroll view by the specified amount.

OnScrollBar ( ) : void

Triggered by the scroll bars when they change.

Press ( bool pressed ) : void

Create a plane on which we will be performing the dragging.

RestrictWithinBounds ( bool instant ) : bool

Restrict the scroll view's contents to be within the scroll view's bounds.

RestrictWithinBounds ( bool instant, bool horizontal, bool vertical ) : bool

Restrict the scroll view's contents to be within the scroll view's bounds.

Scroll ( float delta ) : void

If the object should support the scroll wheel, do it.

SetDragAmount ( float x, float y, bool updateScrollbars ) : void

Changes the drag amount of the scroll view to the specified 0-1 range values. (0, 0) is the top-left corner, (1, 1) is the bottom-right.

UpdatePosition ( ) : void

Call this function after you adjust the scroll view's bounds if you want it to maintain the current scrolled position

UpdateScrollbars ( bool recalculateBounds ) : void

Update the values of the associated scroll bars.

Приватные методы

Метод Описание
Awake ( ) : void

Cache the transform and the panel.

LateUpdate ( ) : void

Apply the dragging momentum.

OnDisable ( ) : void
OnDrawGizmos ( ) : void

Draw a visible orange outline of the bounds.

OnEnable ( ) : void
ResetPosition ( ) : void
Start ( ) : void

Set the initial drag value and register the listener delegates.

UpdateScrollbars ( UIScrollBar, sb, float contentMin, float contentMax, float contentSize, float viewSize, bool inverted ) : void

Helper function used in UpdateScrollbars(float) function above.

Описание методов

DisableSpring() публичный Метод

Disable the spring movement.
public DisableSpring ( ) : void
Результат void

Drag() публичный Метод

Drag the object along the plane.
public Drag ( ) : void
Результат void

MoveAbsolute() публичный Метод

Move the scroll view by the specified amount.
public MoveAbsolute ( Vector3 absolute ) : void
absolute Vector3
Результат void

MoveRelative() публичный Метод

Move the scroll view by the specified amount.
public MoveRelative ( Vector3 relative ) : void
relative Vector3
Результат void

OnScrollBar() публичный Метод

Triggered by the scroll bars when they change.
public OnScrollBar ( ) : void
Результат void

Press() публичный Метод

Create a plane on which we will be performing the dragging.
public Press ( bool pressed ) : void
pressed bool
Результат void

RestrictWithinBounds() публичный Метод

Restrict the scroll view's contents to be within the scroll view's bounds.
public RestrictWithinBounds ( bool instant ) : bool
instant bool
Результат bool

RestrictWithinBounds() публичный Метод

Restrict the scroll view's contents to be within the scroll view's bounds.
public RestrictWithinBounds ( bool instant, bool horizontal, bool vertical ) : bool
instant bool
horizontal bool
vertical bool
Результат bool

Scroll() публичный Метод

If the object should support the scroll wheel, do it.
public Scroll ( float delta ) : void
delta float
Результат void

SetDragAmount() публичный Метод

Changes the drag amount of the scroll view to the specified 0-1 range values. (0, 0) is the top-left corner, (1, 1) is the bottom-right.
public SetDragAmount ( float x, float y, bool updateScrollbars ) : void
x float
y float
updateScrollbars bool
Результат void

UpdatePosition() публичный Метод

Call this function after you adjust the scroll view's bounds if you want it to maintain the current scrolled position
public UpdatePosition ( ) : void
Результат void

UpdateScrollbars() публичный Метод

Update the values of the associated scroll bars.
public UpdateScrollbars ( bool recalculateBounds ) : void
recalculateBounds bool
Результат void

Описание свойств

contentPivot публичное свойство

Content's pivot point -- where it originates from by default.
public UIWidget.Pivot contentPivot
Результат UIWidget.Pivot

customMovement публичное свойство

Custom movement, if the 'movement' field is set to 'Custom'.
public Vector2 customMovement
Результат Vector2

disableDragIfFits публичное свойство

Whether dragging will be disabled if the contents fit.
public bool disableDragIfFits
Результат bool

dragEffect публичное свойство

Effect to apply when dragging.
public DragEffect dragEffect
Результат DragEffect

horizontalScrollBar публичное свойство

Horizontal scrollbar used for visualization.
public UIProgressBar, horizontalScrollBar
Результат UIProgressBar,

iOSDragEmulation публичное свойство

Whether to use iOS drag emulation, where the content only drags at half the speed of the touch/mouse movement when the content edge is within the clipping area.
public bool iOSDragEmulation
Результат bool

list статическое публичное свойство

static public BetterList list
Результат BetterList

momentumAmount публичное свойство

How much momentum gets applied when the press is released after dragging.
public float momentumAmount
Результат float

movement публичное свойство

Type of movement allowed by the scroll view.
public Movement, movement
Результат Movement,

onDragFinished публичное свойство

Event callback to trigger when the drag process finished. Can be used for additional effects, such as centering on some object.
public OnDragFinished onDragFinished
Результат OnDragFinished

restrictWithinPanel публичное свойство

Whether the dragging will be restricted to be within the scroll view's bounds.
public bool restrictWithinPanel
Результат bool

scrollWheelFactor публичное свойство

Effect the scroll wheel will have on the momentum.
public float scrollWheelFactor
Результат float

showScrollBars публичное свойство

Condition that must be met for the scroll bars to become visible.
public ShowCondition showScrollBars
Результат ShowCondition

smoothDragStart публичное свойство

Whether the drag operation will be started smoothly, or if if it will be precise (but will have a noticeable "jump").
public bool smoothDragStart
Результат bool

verticalScrollBar публичное свойство

Vertical scrollbar used for visualization.
public UIProgressBar, verticalScrollBar
Результат UIProgressBar,