Show / Hide Table of Contents

Class SerializationUtils

A collection of utilities to aid in serialization/deserialization of data from loaded experiences.

Inheritance
System.Object
SerializationUtils
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Liminal.SDK.Serialization
Assembly: Liminal.SDK.dll
Syntax
public class SerializationUtils

Methods

| Improve this Doc View Source

AddGlobalSerializableTypes(Assembly)

Adds serializable types from the specified assembly to the global type list.

Declaration
public static void AddGlobalSerializableTypes(Assembly asm)
Parameters
Type Name Description
System.Reflection.Assembly asm

The Assembly to add serializable types from.

| Improve this Doc View Source

AddGlobalSerializableTypes(String)

Adds serializable types from the specified loaded assembly to the global type list.

Declaration
public static void AddGlobalSerializableTypes(string asmName)
Parameters
Type Name Description
System.String asmName

The name of the loaded assembly to add serializable types from.

| Improve this Doc View Source

BuildSerializableTypeSet(Assembly)

Builds a System.Collections.Generic.HashSet<T> of System.Type objects from the specified assembly that are either Unity objects or have the Serializable attribute declared.

Declaration
public static HashSet<Type> BuildSerializableTypeSet(Assembly asm)
Parameters
Type Name Description
System.Reflection.Assembly asm
Returns
Type Description
System.Collections.Generic.HashSet<System.Type>

The hashset of types that was created.

| Improve this Doc View Source

BuildSerializableTypeSet(String)

Builds a System.Collections.Generic.HashSet<T> of System.Type objects from the specified loaded assembly that are either Unity objects or have the Serializable attribute declared.

Declaration
public static HashSet<Type> BuildSerializableTypeSet(string asmName)
Parameters
Type Name Description
System.String asmName

The name of the loaded assembly to build the hashset from.

Returns
Type Description
System.Collections.Generic.HashSet<System.Type>

The hashset of types that was created.

| Improve this Doc View Source

ClearGlobalSerializableTypes()

Clears all types from the global serializable types list.

Declaration
public static void ClearGlobalSerializableTypes()
| Improve this Doc View Source

GetFieldFromHierarchy(Type, String, BindingFlags)

Gets a field from the hierarchy of the suppled type's inheritance chain.

Declaration
public static FieldInfo GetFieldFromHierarchy(Type type, string fieldName, BindingFlags bindingFlags)
Parameters
Type Name Description
System.Type type

The type to retrieve the field from.

System.String fieldName

The name of the field to retrieve.

System.Reflection.BindingFlags bindingFlags

The binding flags of the fields to check.

Returns
Type Description
System.Reflection.FieldInfo

The first field with the specified name from the type's inheritance chain, or null if no field with the supplied name exists.

| Improve this Doc View Source

GetFieldsHierarchy(Type, BindingFlags)

Declaration
public static IEnumerable<FieldInfo> GetFieldsHierarchy(Type type, BindingFlags bindings)
Parameters
Type Name Description
System.Type type
System.Reflection.BindingFlags bindings
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo>
| Improve this Doc View Source

GetUnitySerializableFields(Type)

Declaration
public static IEnumerable<FieldInfo> GetUnitySerializableFields(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo>
| Improve this Doc View Source

GetUnitySerializableFieldsHierarchy(Type)

Declaration
public static IEnumerable<FieldInfo> GetUnitySerializableFieldsHierarchy(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo>
| Improve this Doc View Source

HasSerializableAttribute(Type)

Indicates if the type is considered serializable. Types are considered serializable if they explicitly declare System.SerializableAttribute.

Declaration
public static bool HasSerializableAttribute(Type type)
Parameters
Type Name Description
System.Type type

The type to check.

Returns
Type Description
System.Boolean

A boolean indicating if the type is considered serializable.

| Improve this Doc View Source

IsSerializable(FieldInfo)

Indicates if the field is considered serializable. Public fields are always serializable, so long as they are not marked with System.NonSerializedAttribute. All other access levels are only serializable if the explicitly declare the UnityEngine.SerializeField attribute.

Declaration
public static bool IsSerializable(FieldInfo field)
Parameters
Type Name Description
System.Reflection.FieldInfo field

The field to check.

Returns
Type Description
System.Boolean

A boolean indicating if the field is considered serializable.

| Improve this Doc View Source

IsUnityEventType(Type)

Indicates if the supplied type inherits from UnityEngine.Events.UnityEventBase.

Declaration
public static bool IsUnityEventType(Type type)
Parameters
Type Name Description
System.Type type

The type to check.

Returns
Type Description
System.Boolean

A boolean indicating if the supplied type inherits from UnityEngine.Events.UnityEventBase.

| Improve this Doc View Source

IsUnityObjectCollectionType(Type)

Indicates if the specified type is an Array or List of Unity objects.

Declaration
public static bool IsUnityObjectCollectionType(Type type)
Parameters
Type Name Description
System.Type type

The type to check.

Returns
Type Description
System.Boolean

A boolean indicating if the specified type is an Array or List of Unity objects.

| Improve this Doc View Source

IsUnityObjectType(Type)

Indicates if the supplied type inherits from UnityEngine.Object.

Declaration
public static bool IsUnityObjectType(Type type)
Parameters
Type Name Description
System.Type type

The type to check.

Returns
Type Description
System.Boolean

A boolean indicating if the supplied type inherits from UnityEngine.Object.

| Improve this Doc View Source

IsUnityObjectTypeOrCollectionType(Type)

Indicates if the specified type is a Unity Object type, or an Array or List of Unity objects.

Declaration
public static bool IsUnityObjectTypeOrCollectionType(Type type)
Parameters
Type Name Description
System.Type type

The type to check.

Returns
Type Description
System.Boolean

A boolean indicating if the specified type is a Unity Object type, or an Array or List of Unity objects,

| Improve this Doc View Source

IsUnitySerializableField(FieldInfo)

Indicates if the specified field is considered serializable by Unity.

Declaration
public static bool IsUnitySerializableField(FieldInfo field)
Parameters
Type Name Description
System.Reflection.FieldInfo field

The FieldInfo value.

Returns
Type Description
System.Boolean

A boolean indicating if the specified field is considered serializable by Unity.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX