docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ScrollRect

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    UIBehaviour
    ScrollRect
    Implements
    IInitializePotentialDragHandler
    IBeginDragHandler
    IEndDragHandler
    IDragHandler
    IScrollHandler
    IEventSystemHandler
    ICanvasElement
    ILayoutElement
    ILayoutGroup
    ILayoutController
    Inherited Members
    UIBehaviour.Awake()
    UIBehaviour.Start()
    UIBehaviour.OnDestroy()
    UIBehaviour.Reset()
    UIBehaviour.OnBeforeTransformParentChanged()
    UIBehaviour.OnTransformParentChanged()
    UIBehaviour.OnDidApplyAnimationProperties()
    UIBehaviour.OnCanvasGroupChanged()
    UIBehaviour.OnCanvasHierarchyChanged()
    UIBehaviour.IsDestroyed()
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.didStart
    MonoBehaviour.didAwake
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.GetComponentIndex()
    Component.CompareTag(string)
    Component.CompareTag(TagHandle)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.UI
    Assembly: UnityEngine.UI.dll
    Syntax
    [AddComponentMenu("UI/Scroll Rect", 37)]
    [SelectionBase]
    [ExecuteAlways]
    [DisallowMultipleComponent]
    [RequireComponent(typeof(RectTransform))]
    public class ScrollRect : UIBehaviour, IInitializePotentialDragHandler, IBeginDragHandler, IEndDragHandler, IDragHandler, IScrollHandler, IEventSystemHandler, ICanvasElement, ILayoutElement, ILayoutGroup, ILayoutController

    Constructors

    ScrollRect()

    Declaration
    protected ScrollRect()

    Fields

    m_ContentBounds

    Declaration
    protected Bounds m_ContentBounds
    Field Value
    Type Description
    Bounds

    m_ContentStartPosition

    Declaration
    protected Vector2 m_ContentStartPosition
    Field Value
    Type Description
    Vector2

    Properties

    content

    The content that can be scrolled. It should be a child of the GameObject with ScrollRect on it.

    Declaration
    public RectTransform content { get; set; }
    Property Value
    Type Description
    RectTransform
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI; // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
        public RectTransform scrollableContent;
    
        //Do this when the Save button is selected.
        public void Start()
        {
            // assigns the contect that can be scrolled using the ScrollRect.
            myScrollRect.content = scrollableContent;
        }
    }

    decelerationRate

    The rate at which movement slows down.

    Declaration
    public float decelerationRate { get; set; }
    Property Value
    Type Description
    float
    Remarks

    The deceleration rate is the speed reduction per second. A value of 0.5 halves the speed each second. The default is 0.135. The deceleration rate is only used when inertia is enabled.

    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI; // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
    
        public void Start()
        {
            // assigns a new value to the decelerationRate of the scroll rect.
            // The higher the number the longer it takes to decelerate.
            myScrollRect.decelerationRate = 5.0f;
        }
    }

    elasticity

    The amount of elasticity to use when the content moves beyond the scroll rect.

    Declaration
    public float elasticity { get; set; }
    Property Value
    Type Description
    float
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
    
        public void Start()
        {
            // assigns a new value to the elasticity of the scroll rect.
            // The higher the number the longer it takes to snap back.
            myScrollRect.elasticity = 3.0f;
        }
    }

    flexibleHeight

    Called by the layout system.

    Declaration
    public virtual float flexibleHeight { get; }
    Property Value
    Type Description
    float

    flexibleWidth

    Called by the layout system.

    Declaration
    public virtual float flexibleWidth { get; }
    Property Value
    Type Description
    float

    horizontal

    Should horizontal scrolling be enabled?

    Declaration
    public bool horizontal { get; set; }
    Property Value
    Type Description
    bool
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI; // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
    
        public void Start()
        {
            // Is horizontal scrolling enabled?
            if (myScrollRect.horizontal == true)
            {
                Debug.Log("Horizontal Scrolling is Enabled!");
            }
        }
    }

    horizontalNormalizedPosition

    The horizontal scroll position as a value between 0 and 1, with 0 being at the left.

    Declaration
    public float horizontalNormalizedPosition { get; set; }
    Property Value
    Type Description
    float
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;  // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
        public Scrollbar newScrollBar;
    
        public void Start()
        {
            //Change the current horizontal scroll position.
            myScrollRect.horizontalNormalizedPosition = 0.5f;
        }
    }

    horizontalScrollbar

    Optional Scrollbar object linked to the horizontal scrolling of the ScrollRect.

    Declaration
    public Scrollbar horizontalScrollbar { get; set; }
    Property Value
    Type Description
    Scrollbar
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;  // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
        public Scrollbar newScrollBar;
    
        public void Start()
        {
            // Assigns a scroll bar element to the ScrollRect, allowing you to scroll in the horizontal axis.
            myScrollRect.horizontalScrollbar = newScrollBar;
        }
    }

    horizontalScrollbarSpacing

    The space between the scrollbar and the viewport.

    Declaration
    public float horizontalScrollbarSpacing { get; set; }
    Property Value
    Type Description
    float

    horizontalScrollbarVisibility

    The mode of visibility for the horizontal scrollbar.

    Declaration
    public ScrollRect.ScrollbarVisibility horizontalScrollbarVisibility { get; set; }
    Property Value
    Type Description
    ScrollRect.ScrollbarVisibility

    inertia

    Should movement inertia be enabled?

    Declaration
    public bool inertia { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    Inertia means that the scrollrect content will keep scrolling for a while after being dragged. It gradually slows down according to the decelerationRate.

    layoutPriority

    Called by the layout system.

    Declaration
    public virtual int layoutPriority { get; }
    Property Value
    Type Description
    int

    minHeight

    Called by the layout system.

    Declaration
    public virtual float minHeight { get; }
    Property Value
    Type Description
    float

    minWidth

    Called by the layout system.

    Declaration
    public virtual float minWidth { get; }
    Property Value
    Type Description
    float

    movementType

    The behavior to use when the content moves beyond the scroll rect.

    Declaration
    public ScrollRect.MovementType movementType { get; set; }
    Property Value
    Type Description
    ScrollRect.MovementType

    normalizedPosition

    The scroll position as a Vector2 between (0,0) and (1,1) with (0,0) being the lower left corner.

    Declaration
    public Vector2 normalizedPosition { get; set; }
    Property Value
    Type Description
    Vector2
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;  // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
        public Vector2 myPosition = new Vector2(0.5f, 0.5f);
    
        public void Start()
        {
            //Change the current scroll position.
            myScrollRect.normalizedPosition = myPosition;
        }
    }

    onValueChanged

    Callback executed when the position of the child changes.

    Declaration
    public ScrollRect.ScrollRectEvent onValueChanged { get; set; }
    Property Value
    Type Description
    ScrollRect.ScrollRectEvent
    Remarks

    onValueChanged is used to watch for changes in the ScrollRect object. The onValueChanged call will use the UnityEvent.AddListener API to watch for changes. When changes happen script code provided by the user will be called. The UnityEvent.AddListener API for UI.ScrollRect._onValueChanged takes a Vector2.

    Note: The editor allows the onValueChanged value to be set up manually.For example the value can be set to run only a runtime. The object and script function to call are also provided here.

    The onValueChanged variable can be alternatively set-up at runtime.The script example below shows how this can be done.The script is attached to the ScrollRect object.

    Examples
    using UnityEngine;
    using UnityEngine.UI;
    
    public class ExampleScript : MonoBehaviour
    {
        static ScrollRect scrollRect;
    
        void Start()
        {
            scrollRect = GetComponent<ScrollRect>();
            scrollRect.onValueChanged.AddListener(ListenerMethod);
        }
    
        public void ListenerMethod(Vector2 value)
        {
            Debug.Log("ListenerMethod: " + value);
        }
    }

    preferredHeight

    Called by the layout system.

    Declaration
    public virtual float preferredHeight { get; }
    Property Value
    Type Description
    float

    preferredWidth

    Called by the layout system.

    Declaration
    public virtual float preferredWidth { get; }
    Property Value
    Type Description
    float

    scrollSensitivity

    The sensitivity to scroll wheel and track pad scroll events.

    Declaration
    public float scrollSensitivity { get; set; }
    Property Value
    Type Description
    float
    Remarks

    Higher values indicate higher sensitivity.

    velocity

    The current velocity of the content.

    Declaration
    public Vector2 velocity { get; set; }
    Property Value
    Type Description
    Vector2
    Remarks

    The velocity is defined in units per second.

    vertical

    Should vertical scrolling be enabled?

    Declaration
    public bool vertical { get; set; }
    Property Value
    Type Description
    bool
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;  // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
    
        public void Start()
        {
            // Is Vertical scrolling enabled?
            if (myScrollRect.vertical == true)
            {
                Debug.Log("Vertical Scrolling is Enabled!");
            }
        }
    }

    verticalNormalizedPosition

    The vertical scroll position as a value between 0 and 1, with 0 being at the bottom.

    Declaration
    public float verticalNormalizedPosition { get; set; }
    Property Value
    Type Description
    float
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;  // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
        public Scrollbar newScrollBar;
    
        public void Start()
        {
            //Change the current vertical scroll position.
            myScrollRect.verticalNormalizedPosition = 0.5f;
        }
    }

    verticalScrollbar

    Optional Scrollbar object linked to the vertical scrolling of the ScrollRect.

    Declaration
    public Scrollbar verticalScrollbar { get; set; }
    Property Value
    Type Description
    Scrollbar
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;  // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
        public Scrollbar newScrollBar;
    
        public void Start()
        {
            // Assigns a scroll bar element to the ScrollRect, allowing you to scroll in the vertical axis.
            myScrollRect.verticalScrollbar = newScrollBar;
        }
    }

    verticalScrollbarSpacing

    The space between the scrollbar and the viewport.

    Declaration
    public float verticalScrollbarSpacing { get; set; }
    Property Value
    Type Description
    float

    verticalScrollbarVisibility

    The mode of visibility for the vertical scrollbar.

    Declaration
    public ScrollRect.ScrollbarVisibility verticalScrollbarVisibility { get; set; }
    Property Value
    Type Description
    ScrollRect.ScrollbarVisibility

    viewRect

    Declaration
    protected RectTransform viewRect { get; }
    Property Value
    Type Description
    RectTransform

    viewport

    Reference to the viewport RectTransform that is the parent of the content RectTransform.

    Declaration
    public RectTransform viewport { get; set; }
    Property Value
    Type Description
    RectTransform

    Methods

    CalculateLayoutInputHorizontal()

    Called by the layout system.

    Declaration
    public virtual void CalculateLayoutInputHorizontal()

    CalculateLayoutInputVertical()

    Called by the layout system.

    Declaration
    public virtual void CalculateLayoutInputVertical()

    GraphicUpdateComplete()

    Callback sent when this ICanvasElement has completed Graphic rebuild.

    Declaration
    public virtual void GraphicUpdateComplete()

    IsActive()

    See member in base class.

    Declaration
    public override bool IsActive()
    Returns
    Type Description
    bool
    Overrides
    UIBehaviour.IsActive()
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.UI;  // Required when Using UI elements.
    
    public class ExampleClass : MonoBehaviour
    {
        public ScrollRect myScrollRect;
    
        public void Start()
        {
            //Checks if the ScrollRect called "myScrollRect" is active.
            if (myScrollRect.IsActive())
            {
                Debug.Log("The Scroll Rect is active!");
            }
        }
    }

    LateUpdate()

    Declaration
    protected virtual void LateUpdate()

    LayoutComplete()

    Callback sent when this ICanvasElement has completed layout.

    Declaration
    public virtual void LayoutComplete()

    OnBeginDrag(PointerEventData)

    Handling for when the content is beging being dragged.

    Declaration
    public virtual void OnBeginDrag(PointerEventData eventData)
    Parameters
    Type Name Description
    PointerEventData eventData
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.EventSystems; // Required when using event data
    
    public class ExampleClass : MonoBehaviour, IBeginDragHandler // required interface when using the OnBeginDrag method.
    {
        //Do this when the user starts dragging the element this script is attached to..
        public void OnBeginDrag(PointerEventData data)
        {
            Debug.Log("They started dragging " + this.name);
        }
    }

    OnDisable()

    Declaration
    protected override void OnDisable()
    Overrides
    UIBehaviour.OnDisable()

    OnDrag(PointerEventData)

    Handling for when the content is dragged.

    Declaration
    public virtual void OnDrag(PointerEventData eventData)
    Parameters
    Type Name Description
    PointerEventData eventData
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.EventSystems; // Required when using event data
    
    public class ExampleClass : MonoBehaviour, IDragHandler // required interface when using the OnDrag method.
    {
        //Do this while the user is dragging this UI Element.
        public void OnDrag(PointerEventData data)
        {
            Debug.Log("Currently dragging " + this.name);
        }
    }

    OnEnable()

    Declaration
    protected override void OnEnable()
    Overrides
    UIBehaviour.OnEnable()

    OnEndDrag(PointerEventData)

    Handling for when the content has finished being dragged.

    Declaration
    public virtual void OnEndDrag(PointerEventData eventData)
    Parameters
    Type Name Description
    PointerEventData eventData
    Examples
    using UnityEngine;
    using System.Collections;
    using UnityEngine.EventSystems; // Required when using event data
    
    public class ExampleClass : MonoBehaviour, IEndDragHandler // required interface when using the OnEndDrag method.
    {
        //Do this when the user stops dragging this UI Element.
        public void OnEndDrag(PointerEventData data)
        {
            Debug.Log("Stopped dragging " + this.name + "!");
        }
    }

    OnInitializePotentialDrag(PointerEventData)

    Called by a BaseInputModule when a drag has been found but before it is valid to begin the drag.

    Declaration
    public virtual void OnInitializePotentialDrag(PointerEventData eventData)
    Parameters
    Type Name Description
    PointerEventData eventData

    OnRectTransformDimensionsChange()

    This callback is called when the dimensions of an associated RectTransform change. It is always called before Awake, OnEnable, or Start. The call is also made to all child RectTransforms, regardless of whether their dimensions change (which depends on how they are anchored).

    Declaration
    protected override void OnRectTransformDimensionsChange()
    Overrides
    UIBehaviour.OnRectTransformDimensionsChange()

    OnScroll(PointerEventData)

    Use this callback to detect scroll events.

    Declaration
    public virtual void OnScroll(PointerEventData data)
    Parameters
    Type Name Description
    PointerEventData data

    OnValidate()

    Declaration
    protected override void OnValidate()
    Overrides
    UIBehaviour.OnValidate()

    Rebuild(CanvasUpdate)

    Rebuilds the scroll rect data after initialization.

    Declaration
    public virtual void Rebuild(CanvasUpdate executing)
    Parameters
    Type Name Description
    CanvasUpdate executing

    The current step in the rendering CanvasUpdate cycle.

    SetContentAnchoredPosition(Vector2)

    Sets the anchored position of the content.

    Declaration
    protected virtual void SetContentAnchoredPosition(Vector2 position)
    Parameters
    Type Name Description
    Vector2 position

    SetDirty()

    Override to alter or add to the code that keeps the appearance of the scroll rect synced with its data.

    Declaration
    protected void SetDirty()

    SetDirtyCaching()

    Override to alter or add to the code that caches data to avoid repeated heavy operations.

    Declaration
    protected void SetDirtyCaching()

    SetLayoutHorizontal()

    Called by the layout system.

    Declaration
    public virtual void SetLayoutHorizontal()

    SetLayoutVertical()

    Called by the layout system.

    Declaration
    public virtual void SetLayoutVertical()

    SetNormalizedPosition(float, int)

    Set the horizontal or vertical scroll position as a value between 0 and 1, with 0 being at the left or at the bottom.

    Declaration
    protected virtual void SetNormalizedPosition(float value, int axis)
    Parameters
    Type Name Description
    float value

    The position to set, between 0 and 1.

    int axis

    The axis to set: 0 for horizontal, 1 for vertical.

    StopMovement()

    Sets the velocity to zero on both axes so the content stops moving.

    Declaration
    public virtual void StopMovement()

    UpdateBounds()

    Calculate the bounds the ScrollRect should be using.

    Declaration
    protected void UpdateBounds()

    UpdatePrevData()

    Helper function to update the previous data fields on a ScrollRect. Call this before you change data in the ScrollRect.

    Declaration
    protected void UpdatePrevData()

    Implements

    IInitializePotentialDragHandler
    IBeginDragHandler
    IEndDragHandler
    IDragHandler
    IScrollHandler
    IEventSystemHandler
    ICanvasElement
    ILayoutElement
    ILayoutGroup
    ILayoutController
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)