docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class CachedComponentFilter<TFilterType, TRootType>

    Provides utility functions to retrieve filtered lists of components. The lists created are automatically cached.

    Inheritance
    object
    CachedComponentFilter<TFilterType, TRootType>
    Implements
    IDisposable
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.XR.CoreUtils
    Assembly: solution.dll
    Syntax
    public class CachedComponentFilter<TFilterType, TRootType> : IDisposable where TFilterType : class where TRootType : Component
    Type Parameters
    Name Description
    TFilterType

    The type of component to find.

    TRootType

    The type of component at the root of the hierarchy.

    Examples

    Proper usage of this class is:

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

    Constructors

    Name Description
    CachedComponentFilter(TFilterType[], bool)

    Initializes a new cached component filter.

    CachedComponentFilter(TRootType, CachedSearchType, bool)

    Initializes a new cached component filter.

    Methods

    Name Description
    Dispose()

    Part of the IDisposable pattern.

    Dispose(bool)

    Disposes of the cached component filter.

    GetMatchingComponents<TChildType>()

    Get an array of matching components.

    StoreMatchingComponents<TChildType>(List<TChildType>)

    Store components that match TChildType.

    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)