編輯

共用方式為


ScrollingObjectCollection Class

Definition

A scrollable frame where content scroll is triggered by manual controller click and drag or according to pagination settings.

public ref class ScrollingObjectCollection : UnityEngine::MonoBehaviour, Microsoft::MixedReality::Toolkit::Input::IMixedRealityPointerHandler, Microsoft::MixedReality::Toolkit::Input::IMixedRealitySourceStateHandler, Microsoft::MixedReality::Toolkit::Input::IMixedRealityTouchHandler, UnityEngine::EventSystems::IEventSystemHandler
[UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/ScrollingObjectCollection")]
[UnityEngine.ExecuteAlways]
public class ScrollingObjectCollection : UnityEngine.MonoBehaviour, Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointerHandler, Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler, Microsoft.MixedReality.Toolkit.Input.IMixedRealityTouchHandler, UnityEngine.EventSystems.IEventSystemHandler
[<UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/ScrollingObjectCollection")>]
[<UnityEngine.ExecuteAlways>]
type ScrollingObjectCollection = class
    inherit MonoBehaviour
    interface IMixedRealityPointerHandler
    interface IEventSystemHandler
    interface IMixedRealitySourceStateHandler
    interface IMixedRealityTouchHandler
Public Class ScrollingObjectCollection
Inherits MonoBehaviour
Implements IEventSystemHandler, IMixedRealityPointerHandler, IMixedRealitySourceStateHandler, IMixedRealityTouchHandler
Inheritance
UnityEngine.MonoBehaviour
ScrollingObjectCollection
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.ExecuteAlwaysAttribute
Implements

Remarks

Executing also in edit mode to properly catch and mask any new content added to scroll container.

Constructors

ScrollingObjectCollection()

Fields

OnClick

Event that is fired on the target object when the ScrollingObjectCollection deems event as a Click.

OnMomentumEnded

Event that is fired on the target object when the ScrollingObjectCollection is no longer in motion from velocity

OnMomentumStarted

Event that is fired on the target object when the ScrollingObjectCollection is starting motion with velocity.

OnTouchEnded

Event that is fired on the target object when the ScrollingObjectCollection is no longer touched.

OnTouchStarted

Event that is fired on the target object when the ScrollingObjectCollection is touched.

Properties

AnimationLength

The amount of time (in seconds) the PaginationCurve will take to evaluate.

BounceMultiplier

Multiplier to add more bounce to the overscroll of a list when using FalloffPerFrame or FalloffPerItem.

CanScroll

Enables/disables scrolling with near/far interaction.

CellDepth

Depth of cell used for masking out content renderers that are out of bounds.

CellHeight

Height of the pagination cell.Hhide

CellsPerTier

Number of cells in a row on up-down scroll or number of cells in a column on left-right scroll.

CellWidth

Width of the pagination cell.

ClipBox

The ScrollingObjectCollection's ClippingBox that is used for clipping items in and out of the list.

ClippingObject

The empty GameObject containing the ScrollingObjectCollection's ClippingBox.

ColliderEditMode

Edit modes for defining the scroll interaction collider boundaries. Choose 'Auto' to automatically use pagination values. Choose 'Manual' for enabling direct manipulation of the collider.

DisableClippedGameObjects

Disables GameObjects with Renderer components which are clipped by the clipping box. Improves performance significantly by reducing the number of GameObjects that need to be managed in engine.

DisableClippedRenderers

Disables the Renderer components of Gameobjects which are clipped by the clipping box. Improves performance by reducing the number of renderers that need to be tracked, while still allowing the GameObjects associated with those renders to continue updating. Less performant compared to using DisableClippedGameObjects

FirstHiddenCellIndex

Index of the first hidden cell.

FirstVisibleCellIndex

Index of the first visible cell.

FrontTouchDistance

Distance, in meters, to position a local xy plane used to verify if a touch interaction started in the front of the scroll view.

HandDeltaScrollThreshold

The distance, in meters, the current pointer can travel along the scroll direction before triggering a scroll drag.

HasMomentum

Tracks whether the scroll has any kind of momentum. True if scroll is being dragged by a controller, the velocity is falling off after a drag release or during pagination movement.

IsDragging

Tracks whether the scroll is being dragged due to a controller movement.

IsEngaged

Tracks whether content or scroll background is being interacted with.

IsTouched

Tracks whether the scroll content or background is touched by a near pointer. Remains true while the same near pointer does not cross the scrolling release boundaries.

MaskEditMode

Edit modes for defining the clipping box masking boundaries. Choose 'Auto' to automatically use pagination values. Choose 'Manual' for enabling direct manipulation of the clipping box object.

MaskEnabled

Visibility mode of scroll content. Default value will mask all objects outside of the scroll viewable area.

PaginationCurve

Animation curve used to interpolate the pagination and movement methods.

ReleaseThresholdBack

Withdraw amount, in meters, from the back of the scroll boundary needed to transition from touch engaged to released.

ReleaseThresholdFront

Withdraw amount, in meters, from the front of the scroll boundary needed to transition from touch engaged to released.

ReleaseThresholdLeftRight

Withdraw amount, in meters, from the right or left of the scroll boundary needed to transition from touch engaged to released.

ReleaseThresholdTopBottom

Withdraw amount, in meters, from the top or bottom of the scroll boundary needed to transition from touch engaged to released.

ScrollContainerPosition

The local position of the moving scroll container. Can be used to represent the container drag displacement.

ScrollDirection

The direction in which content should scroll.

ScrollingCollider

Scrolling interaction collider used to catch pointer and touch events on empty spaces.

ScrollingTouchable

Scrolling interaction touchable used to catch touch events on empty spaces.

TiersPerPage

Number of visible tiers in the scrolling area.

TypeOfVelocity

The desired type of velocity for the scroller.

UseOnPreRender

Toggles whether Camera OnPreRender callback will be used to manage content visibility. The fallback is MonoBehaviour.LateUpdate().

VelocityDampen

Amount of drag applied to velocity.

VelocityMultiplier

Amount of (extra) velocity to be applied to scroller.

Methods

AddContent(GameObject)

Safely adds a child game object to scroll collection.

IsCellVisible(Int32)

Checks whether the given cell is visible relative to viewable area or page.

MoveByPages(Int32, Boolean, Action)

Moves scroller container by a multiplier of the number of tiers in the viewable area.

MoveByTiers(Int32, Boolean, Action)

Moves scroller container a relative number of tiers of cells.

MoveToIndex(Int32, Boolean, Action)

Moves scroller container to a position where the selected cell is in the first tier of the viewable area.

RemoveItem(GameObject)

Safely removes a child game object from scroll content and clipping box.

Reset()

Resets the ScrollingObjectCollection

UpdateContent()

Sets up the scroll clipping object and the interactable components according to the scroll content and chosen settings.

Explicit Interface Implementations

IMixedRealityPointerHandler.OnPointerClicked(MixedRealityPointerEventData)

When a pointer clicked event is raised, this method is used to pass along the event data to the input handler.

IMixedRealityPointerHandler.OnPointerDown(MixedRealityPointerEventData)

When a pointer down event is raised, this method is used to pass along the event data to the input handler.

IMixedRealityPointerHandler.OnPointerDragged(MixedRealityPointerEventData)

Called every frame a pointer is down. Can be used to implement drag-like behaviors.

IMixedRealityPointerHandler.OnPointerUp(MixedRealityPointerEventData)

When a pointer up event is raised, this method is used to pass along the event data to the input handler.

IMixedRealitySourceStateHandler.OnSourceDetected(SourceStateEventData)
IMixedRealitySourceStateHandler.OnSourceLost(SourceStateEventData)
IMixedRealityTouchHandler.OnTouchCompleted(HandTrackingInputEventData)

When a Touch motion ends, this handler receives the event.

IMixedRealityTouchHandler.OnTouchStarted(HandTrackingInputEventData)

When a Touch motion has occurred, this handler receives the event.

IMixedRealityTouchHandler.OnTouchUpdated(HandTrackingInputEventData)

When a Touch motion is updated, this handler receives the event.

Applies to