docs.unity3d.com
    Show / Hide Table of Contents

    Class ReflectionUtils

    Inheritance
    Object
    ReflectionUtils
    Namespace: UnityEngine.Rendering.Tests
    Syntax
    public static class ReflectionUtils

    Methods

    FindTypeByName(String)

    Finds a type by full name

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

    The full type name with namespace

    Returns
    Type Description
    Type

    The found type

    GetField(Object, String)

    Gets the value of a private field from a class

    Declaration
    public static object GetField(this object target, string fieldName)
    Parameters
    Type Name Description
    Object target
    String fieldName

    The field to get

    Returns
    Type Description
    Object

    GetFields(Object)

    Gets all the fields from a class

    Declaration
    public static IEnumerable<FieldInfo> GetFields(this object target)
    Parameters
    Type Name Description
    Object target
    Returns
    Type Description
    IEnumerable<FieldInfo>

    Invoke(Object, String, Object[])

    Calls a private method from a class

    Declaration
    public static object Invoke(this object target, string methodName, params object[] args)
    Parameters
    Type Name Description
    Object target
    String methodName

    The method name

    Object[] args

    The arguments to pass to the method

    Returns
    Type Description
    Object

    InvokeStatic(Type, String, Object[])

    Calls a private method from a class

    Declaration
    public static object InvokeStatic(this Type targetType, string methodName, params object[] args)
    Parameters
    Type Name Description
    Type targetType
    String methodName

    The method name

    Object[] args

    The arguments to pass to the method

    Returns
    Type Description
    Object

    SetField(Object, String, Object)

    Sets a private field from a class

    Declaration
    public static void SetField(this object target, string fieldName, object value)
    Parameters
    Type Name Description
    Object target
    String fieldName

    The field to change

    Object value

    The new value

    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