Table of Contents

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

type Type

Returns

object

DeepCopy<T>(T)

Perform a deep copy of the class.

public static T DeepCopy<T>(T obj)

Parameters

obj T

The 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

type Type

The type.

flags BindingFlags

The flags.

Returns

List<FieldInfo>

All fields of the type.

GetGenericArgumentType(Type)

Get type first generic argument type

public static Type GetGenericArgumentType(Type type)

Parameters

type Type

Returns

Type

GetSerializedFields(Type)

Get all fields of type that Unity can serialize

public static List<FieldInfo> GetSerializedFields(Type type)

Parameters

type Type

Returns

List<FieldInfo>

GetSerializedFieldsName(Type)

Get all field names of type that Unity can serialize

public static List<string> GetSerializedFieldsName(Type type)

Parameters

type Type

Returns

List<string>

IsInheritedFromGenericDefinition(Type, Type)

public static bool IsInheritedFromGenericDefinition(Type type, Type genericDefinition)

Parameters

type Type
genericDefinition Type

Returns

bool

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

type Type
genericDefinition Type
arguments Type[]

Returns

bool

IsSerializableNumericTypes(Type)

public static bool IsSerializableNumericTypes(Type type)

Parameters

type Type

Returns

bool

IsUnityBuiltinTypes(Type)

public static bool IsUnityBuiltinTypes(Type type)

Parameters

type Type

Returns

bool