Class ReflectionUtils
Inherited Members
Namespace: UnityEngine.Rendering.Tests
Assembly: Unity.RenderPipelines.Core.Editor.Tests.dll
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, params 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, params 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 |