docs.unity3d.com
    Show / Hide Table of Contents

    Class CollectionWrapper<T>

    Represents an abstract collection of items. The items are stored internally as List. Implement your own concrete collections by inheriting from this class.

    Inheritance
    Object
    CollectionWrapper
    CollectionWrapper<T>
    ComponentAddedCriterion.SerializedTypeCollection
    Tutorial.TutorialPageCollection
    TutorialParagraphCollection
    Namespace: Unity.Tutorials.Core.Editor
    Syntax
    public abstract class CollectionWrapper<T> : CollectionWrapper, IEnumerable<T>
    Type Parameters
    Name Description
    T

    The type of elements in the collection.

    Constructors

    CollectionWrapper()

    Default-constructs an empty collection.

    Declaration
    public CollectionWrapper()

    CollectionWrapper(IList<T>)

    Constructs with items.

    Declaration
    public CollectionWrapper(IList<T> items)
    Parameters
    Type Name Description
    IList<T> items

    Properties

    Count

    The count of items.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    Int32

    Item[Int32]

    Returns an item at a specific index.

    Declaration
    public T this[int i] { get; set; }
    Parameters
    Type Name Description
    Int32 i
    Property Value
    Type Description
    T

    Methods

    AddItem(T)

    Adds an item to the collection

    Declaration
    public void AddItem(T item)
    Parameters
    Type Name Description
    T item

    GetEnumerator()

    Returns an Enumerator to the items.

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    IEnumerator<T>

    GetItems(List<T>)

    Returns the items of the collection as a list.

    Declaration
    public void GetItems(List<T> items)
    Parameters
    Type Name Description
    List<T> items

    SetItems(IEnumerable<T>)

    Sets the items of the collection.

    Declaration
    public void SetItems(IEnumerable<T> items)
    Parameters
    Type Name Description
    IEnumerable<T> items
    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