Class ReflectionUtils
Namespace: Unity.Reflect
Syntax
public static class ReflectionUtils
Methods
AreRelated(Type, Type)
Check if 2 types are related through interface implementation, parent/child relation or if they are the same type.
Declaration
public static bool AreRelated(Type t1, Type t2)
Parameters
Type | Name | Description |
---|---|---|
Type | t1 | |
Type | t2 |
Returns
Type | Description |
---|---|
Boolean |
ExtractTypes(String)
Convert a type (string) to an hierarchy of ReflectionUtils.StringTypeElem, effectively extracting general information about the string.
Declaration
public static ReflectionUtils.StringTypeElem ExtractTypes(string fullName)
Parameters
Type | Name | Description |
---|---|---|
String | fullName | The full name of the type, including generic type if there is any. |
Returns
Type | Description |
---|---|
ReflectionUtils.StringTypeElem |
FlushCache()
Declaration
public static void FlushCache()
GetClosedTypeFromAnyAssembly(String)
Get the closed type for the
Declaration
public static Type GetClosedTypeFromAnyAssembly(string closedType)
Parameters
Type | Name | Description |
---|---|---|
String | closedType | The type as a string without the assembly qualifier e.g. "System.Int32", "System.Collections.Generic.List`1[System.Int32]" |
Returns
Type | Description |
---|---|
Type | The type found in any loaded assembly. |
Remarks
This method works with nested generic type. If the string is not a closed type, this method may throw. If the type does not exist, this method may throw.