docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method FindTypesBatch

    FindTypesBatch(List<Func<Type, bool>>, List<Type>)

    Search all assemblies for a set of types that matches any one of a set of predicates.

    Declaration
    public static void FindTypesBatch(List<Func<Type, bool>> predicates, List<Type> resultList)
    Parameters
    Type Name Description
    List<Func<Type, bool>> predicates

    The predicate functions. A predicate function must return true for the type that matches the search and should only match one type.

    List<Type> resultList

    The list to which found types will be added. The list must have the same number of elements as the predicates list.

    Remarks

    This function tests each predicate against each type in each assembly. If the predicate returns true for a type, then that Type object is assigned to the corresponding index of the resultList. If a predicate returns true for more than one type, then the last matching result is used. If no type matches the predicate, then that index of resultList is left unchanged.

    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)