Class ReflectionUtility
- Namespace
- Ceres
- Assembly
- Ceres.dll
public static class ReflectionUtility
- Inheritance
-
ReflectionUtility
- Inherited Members
Methods
CreateDefaultValue(Type)
public static object CreateDefaultValue(Type type)
Parameters
typeType
Returns
DeepCopy<T>(T)
Perform a deep copy of the class.
public static T DeepCopy<T>(T obj)
Parameters
objTThe object.
Returns
- T
A deep copy of obj.
Type Parameters
T
Exceptions
- ArgumentNullException
Object cannot be null
GetAllFields(Type, BindingFlags)
Gets all fields from an object and its hierarchy inheritance.
public static List<FieldInfo> GetAllFields(this Type type, BindingFlags flags)
Parameters
typeTypeThe type.
flagsBindingFlagsThe flags.
Returns
GetGenericArgumentType(Type)
Get type first generic argument type
public static Type GetGenericArgumentType(Type type)
Parameters
typeType
Returns
GetSerializedFields(Type)
Get all fields of type that Unity can serialize
public static List<FieldInfo> GetSerializedFields(Type type)
Parameters
typeType
Returns
GetSerializedFieldsName(Type)
Get all field names of type that Unity can serialize
public static List<string> GetSerializedFieldsName(Type type)
Parameters
typeType
Returns
IsInheritedFromGenericDefinition(Type, Type)
public static bool IsInheritedFromGenericDefinition(Type type, Type genericDefinition)
Parameters
Returns
IsInheritedFromGenericDefinition(Type, Type, out Type[])
Determines whether the specified type inherits from the specified generic type definition, and obtains the generic parameter type.
public static bool IsInheritedFromGenericDefinition(this Type type, Type genericDefinition, out Type[] arguments)
Parameters
Returns
IsSerializableNumericTypes(Type)
public static bool IsSerializableNumericTypes(Type type)
Parameters
typeType
Returns
IsUnityBuiltinTypes(Type)
public static bool IsUnityBuiltinTypes(Type type)
Parameters
typeType