Class ListViewControllerBase | List View Framework | 1.1.7-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class ListViewControllerBase

    Provides base List View Controller functionality which does not require generic arguments Allows reference to any ListViewController type without specifying generic arguments

    Inheritance
    Object
    Object
    Component
    Behaviour
    MonoBehaviour
    ListViewControllerBase
    ListViewController<TData, TItem, TIndex>
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(String, Single)
    MonoBehaviour.InvokeRepeating(String, Single, Single)
    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.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, Component)
    Component.TryGetComponent<T>(T)
    Component.GetComponent(String)
    Component.GetComponentInChildren(Type, Boolean)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(Boolean)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, Boolean)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(Boolean)
    Component.GetComponentsInChildren<T>(Boolean, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, Boolean)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(Boolean)
    Component.GetComponentsInParent<T>(Boolean, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(String)
    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
    Component.rigidbody
    Component.rigidbody2D
    Component.camera
    Component.light
    Component.animation
    Component.constantForce
    Component.renderer
    Component.audio
    Component.networkView
    Component.collider
    Component.collider2D
    Component.hingeJoint
    Component.particleSystem
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    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, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: Unity.ListViewFramework
    Syntax
    public abstract class ListViewControllerBase : MonoBehaviour, IScrollHandler, IEventSystemHandler

    Fields

    m_EnableSettling

    Whether to interpolate item positions

    Declaration
    [Tooltip("Whether to interpolate item positions")]
    [SerializeField]
    protected bool m_EnableSettling
    Field Value
    Type Description
    Boolean

    m_Extents

    The extents (half the size) of the list area

    Declaration
    protected Vector3 m_Extents
    Field Value
    Type Description
    Vector3

    m_ItemSize

    The size of each item

    Declaration
    protected Vector3 m_ItemSize
    Field Value
    Type Description
    Vector3

    m_Padding

    Padding between items

    Declaration
    [Tooltip("Padding between items")]
    [SerializeField]
    protected float m_Padding
    Field Value
    Type Description
    Single

    m_ScrollDelta

    The current amount of scroll momentum

    Declaration
    protected float m_ScrollDelta
    Field Value
    Type Description
    Single

    m_Scrolling

    Whether this list is currently scrolling

    Declaration
    protected bool m_Scrolling
    Field Value
    Type Description
    Boolean

    m_ScrollOffset

    Distance we have scrolled from initial position

    Declaration
    [Tooltip("Distance we have scrolled from initial position")]
    [SerializeField]
    protected float m_ScrollOffset
    Field Value
    Type Description
    Single

    m_ScrollReturn

    The offset to which this list will return when it stops scrolling Set to float.MaxValue if the list should stay where it is

    Declaration
    protected float m_ScrollReturn
    Field Value
    Type Description
    Single

    m_SettleSpeed

    Speed at which items settle

    Declaration
    [Tooltip("Speed at which items settle")]
    [SerializeField]
    protected float m_SettleSpeed
    Field Value
    Type Description
    Single

    m_Settling

    Whether the items in this list are currently settling

    Declaration
    protected bool m_Settling
    Field Value
    Type Description
    Boolean

    m_Size

    The size of the list area

    Declaration
    protected Vector3 m_Size
    Field Value
    Type Description
    Vector3

    m_StartPosition

    The starting position from which to offset items

    Declaration
    protected Vector3 m_StartPosition
    Field Value
    Type Description
    Vector3

    m_Templates

    Item template prefabs (at least one is required)

    Declaration
    [Tooltip("Item template prefabs (at least one is required)")]
    [SerializeField]
    protected GameObject[] m_Templates
    Field Value
    Type Description
    GameObject[]

    Properties

    itemSize

    The size of each item

    Declaration
    public Vector3 itemSize { get; }
    Property Value
    Type Description
    Vector3

    listHeight

    The total height of all list rows, used to determine the maximum amount of scroll offset before snapping back

    Declaration
    protected abstract float listHeight { get; }
    Property Value
    Type Description
    Single

    scrollOffset

    The distance we have scrolled from initial position

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

    scrollSpeed

    The speed of fixed-speed scrolling

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

    size

    The size of the list area

    Declaration
    public virtual Vector3 size { set; }
    Property Value
    Type Description
    Vector3

    Methods

    Awake()

    Called when the script instance is being loaded

    Declaration
    protected virtual void Awake()

    ComputeConditions()

    Called by UpdateView to update fields which control the state of the entire list

    Declaration
    protected virtual void ComputeConditions()

    EndSettling()

    Called when items are done settling

    Declaration
    protected virtual void EndSettling()

    GetObjectSize(GameObject)

    Get the size of a given GameObject

    Declaration
    protected virtual Vector3 GetObjectSize(GameObject g)
    Parameters
    Type Name Description
    GameObject g

    The GameObject

    Returns
    Type Description
    Vector3

    The size of the GameObject, which by default is the size of the renderer returned by GetComponentInChildren, if any exists

    HasData()

    Check whether the m_Data array is null

    Declaration
    protected abstract bool HasData()
    Returns
    Type Description
    Boolean

    True if m_Data is not null

    OnScroll(PointerEventData)

    Called every frame while scrolling this list

    Declaration
    public virtual void OnScroll(PointerEventData eventData)
    Parameters
    Type Name Description
    UnityEngine.EventSystems.PointerEventData eventData

    The input event data

    Implements
    UnityEngine.EventSystems.IScrollHandler.OnScroll(UnityEngine.EventSystems.PointerEventData)

    OnScrollEnded()

    Called when scrolling ends

    Declaration
    public virtual void OnScrollEnded()

    OnScrollStarted()

    Called when scrolling is started

    Declaration
    public virtual void OnScrollStarted()

    ScrollNext()

    Scroll the next item

    Declaration
    public virtual void ScrollNext()

    ScrollPrevious()

    Scroll to the previous item

    Declaration
    public virtual void ScrollPrevious()

    ScrollTo(Int32)

    Scroll to an item based on its index in the list order (not its data index)

    Declaration
    public virtual void ScrollTo(int index)
    Parameters
    Type Name Description
    Int32 index

    StartSettling(Action)

    Start the process of letting the list items settle into place

    Declaration
    protected virtual void StartSettling(Action onComplete = null)
    Parameters
    Type Name Description
    Action onComplete

    Called when all items are done settling

    Update()

    Called every frame, if the MonoBehaviour is enabled

    Declaration
    protected virtual void Update()

    UpdateItem(IListViewItem, Int32, Single, Boolean, ref Boolean)

    Update a single item

    Declaration
    protected virtual void UpdateItem(IListViewItem item, int order, float offset, bool dontSettle, ref bool doneSettling)
    Parameters
    Type Name Description
    IListViewItem item

    The item to update

    Int32 order

    The order of this item, among the other visible items

    Single offset

    The offset at which to position this item

    Boolean dontSettle

    Whether to bypass settling behavior

    Boolean doneSettling

    Whether all items are done settling

    UpdateItems()

    Called by UpdateView to update the list items

    Declaration
    protected abstract void UpdateItems()

    UpdateItemTransform(IListViewItem, Int32, Vector3, Quaternion, Boolean, ref Boolean)

    Update the transform of a single item

    Declaration
    protected virtual void UpdateItemTransform(IListViewItem item, int order, Vector3 targetPosition, Quaternion targetRotation, bool dontSettle, ref bool doneSettling)
    Parameters
    Type Name Description
    IListViewItem item

    The item to update

    Int32 order

    The order of this item, among the other visible items

    Vector3 targetPosition

    The target position

    Quaternion targetRotation

    The target rotation

    Boolean dontSettle

    Whether to bypass settling behavior

    Boolean doneSettling

    Whether all items are done settling

    UpdateView()

    Update the list view, called once per frame

    Declaration
    protected virtual void UpdateView()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023