Class CachedComponentFilter<TFilterType, TRootType> | Unity Reflect | 1.0.0-preview.11
docs.unity3d.com
    Show / Hide Table of Contents

    Class CachedComponentFilter<TFilterType, TRootType>

    Class that allows for cached retrieval/filtering of multiple types of components into lists Proper usage of this class is:

    using (var componentFilter = new CachedComponentFilter<typeToFind,componentTypeThatContains>(instanceOfComponent)) {

    }

    Inheritance
    Object
    CachedComponentFilter<TFilterType, TRootType>
    Namespace: Unity.Labs.Utils
    Syntax
    public class CachedComponentFilter<TFilterType, TRootType> : IDisposable where TFilterType : class where TRootType : Component
    Type Parameters
    Name Description
    TFilterType
    TRootType

    Constructors

    CachedComponentFilter(TFilterType[], Boolean)

    Declaration
    public CachedComponentFilter(TFilterType[] componentList, bool includeDisabled = true)
    Parameters
    Type Name Description
    TFilterType[] componentList
    Boolean includeDisabled

    CachedComponentFilter(TRootType, CachedSearchType, Boolean)

    Declaration
    public CachedComponentFilter(TRootType componentRoot, CachedSearchType cachedSearchType = CachedSearchType.Children | CachedSearchType.Self, bool includeDisabled = true)
    Parameters
    Type Name Description
    TRootType componentRoot
    CachedSearchType cachedSearchType
    Boolean includeDisabled

    Methods

    Dispose()

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    GetMatchingComponents<TChildType>()

    Declaration
    public TChildType[] GetMatchingComponents<TChildType>()
        where TChildType : class, TFilterType
    Returns
    Type Description
    TChildType[]
    Type Parameters
    Name Description
    TChildType

    StoreMatchingComponents<TChildType>(List<TChildType>)

    Declaration
    public void StoreMatchingComponents<TChildType>(List<TChildType> outputList)
        where TChildType : class, TFilterType
    Parameters
    Type Name Description
    List<TChildType> outputList
    Type Parameters
    Name Description
    TChildType
    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