Namespace: | Sirenix.Serialization |
Assembly: | Sirenix.Serialization |
public static class UnitySerializationUtility
Note that setting the IndexReferenceResolver on contexts passed into methods on this class will have no effect, as it will always be set to a UnityReferenceResolver.
public static readonly Type SerializeReferenceAttributeType
public static bool ForceEditorModeSerialization { get; set; }
public static object CreateDefaultUnityInitializedObject(Type type)
System.Type | type |
System.Object |
public static List<PrefabModification> DeserializePrefabModifications(List<string> modifications, List<Object> referencedUnityObjects)
System.Collections.Generic.List<System.String> | modifications | |
System.Collections.Generic.List<UnityEngine.Object> | referencedUnityObjects |
System.Collections.Generic.List<PrefabModification> |
public static void DeserializeUnityObject(Object unityObject, IDataReader reader)
UnityEngine.Object | unityObject | |
Sirenix.Serialization.IDataReader | reader |
public static void DeserializeUnityObject(Object unityObject, ref SerializationData data, DeserializationContext context = null)
UnityEngine.Object | unityObject | |
SerializationData | data | |
DeserializationContext | context |
public static void DeserializeUnityObject(Object unityObject, ref byte[] bytes, ref List<Object> referencedUnityObjects, DataFormat format, DeserializationContext context = null)
UnityEngine.Object | unityObject | |
System.Byte[] | bytes | |
System.Collections.Generic.List<UnityEngine.Object> | referencedUnityObjects | |
DataFormat | format | |
DeserializationContext | context |
public static void DeserializeUnityObject(Object unityObject, ref string base64Bytes, ref List<Object> referencedUnityObjects, DataFormat format, DeserializationContext context = null)
UnityEngine.Object | unityObject | |
System.String | base64Bytes | |
System.Collections.Generic.List<UnityEngine.Object> | referencedUnityObjects | |
DataFormat | format | |
DeserializationContext | context |
public static List<PrefabModification> GetRegisteredPrefabModifications(Object obj)
UnityEngine.Object | obj |
System.Collections.Generic.List<PrefabModification> |
public static bool GuessIfUnityWillSerialize(MemberInfo member)
System.Reflection.MemberInfo | member | The member to check. |
System.Boolean | True if it is guessed that Unity will serialize the member, otherwise false. |
System.ArgumentNullException | The parameter |
public static bool GuessIfUnityWillSerialize(Type type)
System.Type | type | The type to check. |
System.Boolean | True if it is guessed that Unity will serialize the type, otherwise false. |
System.ArgumentNullException | The parameter |
public static bool HasModificationsWaitingForDelayedApply(Object obj)
UnityEngine.Object | obj |
System.Boolean |
public static bool OdinWillSerialize(MemberInfo member, bool serializeUnityFields, ISerializationPolicy policy = null)
System.Reflection.MemberInfo | member | The member to check. |
System.Boolean | serializeUnityFields | Whether to allow serialization of members that will also be serialized by Unity. |
Sirenix.Serialization.ISerializationPolicy | policy | The policy that Odin should be using for serialization of the given member. If this parameter is null, it defaults to Unity. |
System.Boolean | True if Odin will serialize the member, otherwise false. |
public static void RegisterPrefabModificationsChange(Object unityObject, List<PrefabModification> modifications)
UnityEngine.Object | unityObject | |
System.Collections.Generic.List<PrefabModification> | modifications |
public static List<string> SerializePrefabModifications(List<PrefabModification> modifications, ref List<Object> referencedUnityObjects)
System.Collections.Generic.List<PrefabModification> | modifications | |
System.Collections.Generic.List<UnityEngine.Object> | referencedUnityObjects |
System.Collections.Generic.List<System.String> |
public static void SerializeUnityObject(Object unityObject, IDataWriter writer, bool serializeUnityFields = false)
UnityEngine.Object | unityObject | |
Sirenix.Serialization.IDataWriter | writer | |
System.Boolean | serializeUnityFields |
public static void SerializeUnityObject(Object unityObject, ref SerializationData data, bool serializeUnityFields = false, SerializationContext context = null)
UnityEngine.Object | unityObject | |
SerializationData | data | |
System.Boolean | serializeUnityFields | |
SerializationContext | context |
public static void SerializeUnityObject(Object unityObject, ref byte[] bytes, ref List<Object> referencedUnityObjects, DataFormat format, bool serializeUnityFields = false, SerializationContext context = null)
UnityEngine.Object | unityObject | |
System.Byte[] | bytes | |
System.Collections.Generic.List<UnityEngine.Object> | referencedUnityObjects | |
DataFormat | format | |
System.Boolean | serializeUnityFields | |
SerializationContext | context |
public static void SerializeUnityObject(Object unityObject, ref string base64Bytes, ref List<Object> referencedUnityObjects, DataFormat format, bool serializeUnityFields = false, SerializationContext context = null)
UnityEngine.Object | unityObject | |
System.String | base64Bytes | |
System.Collections.Generic.List<UnityEngine.Object> | referencedUnityObjects | |
DataFormat | format | |
System.Boolean | serializeUnityFields | |
SerializationContext | context |