Class ReflectionUtils | Unity Reflect | 1.0.0-preview.11
docs.unity3d.com
    Show / Hide Table of Contents

    Class ReflectionUtils

    Inheritance
    Object
    ReflectionUtils
    Namespace: Unity.Labs.Utils
    Syntax
    public static class ReflectionUtils

    Methods

    FindType(Func<Type, Boolean>)

    Search all assemblies for a type that matches a given predicate delegate

    Declaration
    public static Type FindType(Func<Type, bool> predicate)
    Parameters
    Type Name Description
    Func<Type, Boolean> predicate

    The predicate; Returns true for the type that matches the search

    Returns
    Type Description
    Type

    The type found, or null if no matching type exists

    FindTypeByFullName(String)

    Declaration
    public static Type FindTypeByFullName(string fullName)
    Parameters
    Type Name Description
    String fullName
    Returns
    Type Description
    Type

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

    Search all assemblies for a set of types that matches a set of predicates

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

    The predicates; Returns true for the type that matches each search

    List<Type> resultList

    The list to which found types will be added

    FindTypesByFullNameBatch(List<String>, List<Type>)

    Search all assemblies for types that match a set of full names

    Declaration
    public static void FindTypesByFullNameBatch(List<string> typeNames, List<Type> resultList)
    Parameters
    Type Name Description
    List<String> typeNames

    A list containing the names of the types to find

    List<Type> resultList

    An empty list which will be used to collect matching types

    ForEachAssembly(Action<Assembly>)

    Iterate through all assemblies and execute a method on each one Catches ReflectionTypeLoadExceptions in each iteration of the loop

    Declaration
    public static void ForEachAssembly(Action<Assembly> callback)
    Parameters
    Type Name Description
    Action<Assembly> callback

    The callback method to execute for each assembly

    ForEachType(Action<Type>)

    Execute a callback for each type in every assembly

    Declaration
    public static void ForEachType(Action<Type> callback)
    Parameters
    Type Name Description
    Action<Type> callback

    The callback to execute

    NicifyVariableName(String)

    Declaration
    public static string NicifyVariableName(string name)
    Parameters
    Type Name Description
    String name
    Returns
    Type Description
    String

    PreWarmTypeCache()

    Declaration
    public static void PreWarmTypeCache()
    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