Class ReflectionUtils
Namespace: UnityEngine.Rendering.Tests
Syntax
public static class ReflectionUtils
Methods
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 |
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 |