docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetItems

    GetItems()

    Returns an array of all the TItemAsset instances of this catalog.

    Declaration
    public TItemAsset[] GetItems()
    Returns
    Type Description
    TItemAsset[]

    An array of all item definitions.

    Remarks

    Keep in mind that this method allocates an array. If you want to avoid allocations, please consider using GetItems(ICollection<TItemAsset>) instead.

    GetItems(ICollection<TItemAsset>)

    Fills in the given target collection with all TItemAsset instances of this catalog and returns their count. The target collection is cleared before being populated.

    Declaration
    public int GetItems(ICollection<TItemAsset> target = null)
    Parameters
    Type Name Description
    ICollection<TItemAsset> target

    The target container of all the TItemAsset instances.

    Returns
    Type Description
    int

    The number of TItemAsset instances of this catalog.

    GetItems<TInheritedItemAsset>()

    Returns an array of all the TInheritedItemAsset instances of this catalog.

    Declaration
    public TInheritedItemAsset[] GetItems<TInheritedItemAsset>() where TInheritedItemAsset : TItemAsset
    Returns
    Type Description
    TInheritedItemAsset[]

    An array of all item definitions.

    Type Parameters
    Name Description
    TInheritedItemAsset

    The type of items to find.

    Remarks

    Keep in mind that this method allocates an array. If you want to avoid allocations, please consider using GetItems<TInheritedItemAsset>(ICollection<TInheritedItemAsset>) instead.

    GetItems<TInheritedItemAsset>(ICollection<TInheritedItemAsset>)

    Fills in the given target collection with all TItemAssetAsset instances of this catalog and returns their count. The target collection is cleared before being populated.

    Declaration
    public int GetItems<TInheritedItemAsset>(ICollection<TInheritedItemAsset> target = null)
    Parameters
    Type Name Description
    ICollection<TInheritedItemAsset> target

    The target container of all the TItemAssetAsset instances.

    Returns
    Type Description
    int

    The number of TItemAsset instances of this catalog.

    Type Parameters
    Name Description
    TInheritedItemAsset
    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)