docs.unity3d.com
    目次を表示する/隠す

    Class fsObjectProcessor

    Enables injecting code before/after an object has been serialized. This is most useful if you want to run the default serialization process but apply a pre/post processing step.

    Multiple object processors can be active at the same time. When running they are called in a "nested" fashion - if we have processor1 and process2 added to the serializer in that order (p1 then p2), then the execution order will be p1#Before p2#Before /serialization/ p2#After p1#After.

    Inheritance
    Object
    fsObjectProcessor
    fsSerializationCallbackProcessor
    fsSerializationCallbackReceiverProcessor
    Namespace: Unity.VisualScripting.FullSerializer
    Syntax
    public abstract class fsObjectProcessor

    Methods

    CanProcess(Type)

    Is the processor interested in objects of the given type?

    Declaration
    public virtual bool CanProcess(Type type)
    Parameters
    Type Name Description
    Type type

    The given type.

    Returns
    Type Description
    Boolean

    True if the processor should be applied, false otherwise.

    OnAfterDeserialize(Type, Object)

    Called after deserialization.

    Declaration
    public virtual void OnAfterDeserialize(Type storageType, object instance)
    Parameters
    Type Name Description
    Type storageType

    The field/property type that is storing the instance.

    Object instance

    The type of the instance.

    OnAfterSerialize(Type, Object, ref fsData)

    Called after serialization.

    Declaration
    public virtual void OnAfterSerialize(Type storageType, object instance, ref fsData data)
    Parameters
    Type Name Description
    Type storageType

    The field/property type that is storing the instance.

    Object instance

    The type of the instance.

    fsData data

    The data that was serialized.

    OnBeforeDeserialize(Type, ref fsData)

    Called before deserialization.

    Declaration
    public virtual void OnBeforeDeserialize(Type storageType, ref fsData data)
    Parameters
    Type Name Description
    Type storageType

    The field/property type that is storing the instance.

    fsData data

    The data that will be used for deserialization.

    OnBeforeDeserializeAfterInstanceCreation(Type, Object, ref fsData)

    Called before deserialization has begun but after the object instance has been created. This will get invoked even if the user passed in an existing instance.

    Declaration
    public virtual void OnBeforeDeserializeAfterInstanceCreation(Type storageType, object instance, ref fsData data)
    Parameters
    Type Name Description
    Type storageType

    The field/property type that is storing the instance.

    Object instance

    The created object instance. No deserialization has been applied to it.

    fsData data

    The data that will be used for deserialization.

    Remarks

    IMPORTANT: The actual instance that gets passed here is not guaranteed to be an a subtype of storageType, since the value for instance is whatever the active converter returned for CreateInstance() - ie, some converters will return dummy types in CreateInstance() if instance creation cannot be separated from deserialization (ie, KeyValuePair).

    OnBeforeSerialize(Type, Object)

    Called before serialization.

    Declaration
    public virtual void OnBeforeSerialize(Type storageType, object instance)
    Parameters
    Type Name Description
    Type storageType

    The field/property type that is storing the instance.

    Object instance

    The type of the instance.

    Extension Methods

    XAnalyserProvider.Analyser(Object, IGraphContext)
    XAnalyserProvider.Analyser<TAnalyser>(Object, IGraphContext)
    XAnalyserProvider.Analysis(Object, IGraphContext)
    XAnalyserProvider.Analysis<TAnalysis>(Object, IGraphContext)
    XAnalyserProvider.Analyser(Object, GraphReference)
    XAnalyserProvider.Analyser<TAnalyser>(Object, GraphReference)
    XAnalyserProvider.Analysis(Object, GraphReference)
    XAnalyserProvider.Analysis<TAnalysis>(Object, GraphReference)
    XDescriptorProvider.Describe(Object)
    XDescriptorProvider.HasDescriptor(Object)
    XDescriptorProvider.Descriptor(Object)
    XDescriptorProvider.Descriptor<TDescriptor>(Object)
    XDescriptorProvider.Description(Object)
    XDescriptorProvider.Description<TDescription>(Object)
    Cloning.Clone(Object, ICloner, Boolean)
    Cloning.Clone<T>(T, ICloner, Boolean)
    Cloning.CloneViaFakeSerialization(Object)
    Cloning.CloneViaFakeSerialization<T>(T)
    ConversionUtility.IsConvertibleTo(Object, Type, Boolean)
    ConversionUtility.IsConvertibleTo<T>(Object, Boolean)
    ConversionUtility.ConvertTo(Object, Type)
    ConversionUtility.ConvertTo<T>(Object)
    TypeUtility.ToShortString(Object, Int32)
    Serialization.CloneViaSerialization<T>(T, Boolean)
    Serialization.CloneViaSerializationInto<TSource, TDestination>(TSource, ref TDestination, Boolean)
    Serialization.Serialize(Object, Boolean)
    LinqUtility.Yield<T>(T)
    UnityObjectUtility.IsUnityNull(Object)
    UnityObjectUtility.ToSafeString(Object)
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)