Class fsObjectAttribute
This attribute controls some serialization behavior for a type. See the comments on each of the fields for more information.
Namespace: Unity.VisualScripting.FullSerializer
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class fsObjectAttribute : Attribute, _Attribute
Constructors
fsObjectAttribute()
Declaration
public fsObjectAttribute()
fsObjectAttribute(String, Type[])
Declaration
public fsObjectAttribute(string versionString, params Type[] previousModels)
Parameters
Type | Name | Description |
---|---|---|
String | versionString | |
Type[] | previousModels |
Fields
Converter
Specify a custom converter to use for serialization. The converter type needs to derive from fsBaseConverter. This defaults to null.
Declaration
public Type Converter
Field Value
Type | Description |
---|---|
Type |
MemberSerialization
This controls the behavior for member serialization. The default behavior is fsMemberSerialization.Default.
Declaration
public fsMemberSerialization MemberSerialization
Field Value
Type | Description |
---|---|
fsMemberSerialization |
PreviousModels
The previous model that should be used if an old version of this object is encountered. Using this attribute also requires that the type have a public constructor that takes only one parameter, an object instance of the given type. Use of this parameter requires that the VersionString parameter is also set.
Declaration
public Type[] PreviousModels
Field Value
Type | Description |
---|---|
Type[] |
Processor
Specify a custom processor to use during serialization. The processor type needs to derive from fsObjectProcessor and the call to CanProcess is not invoked. This defaults to null.
Declaration
public Type Processor
Field Value
Type | Description |
---|---|
Type |
VersionString
The version string to use for this model. This should be unique among all prior versions of this model that is supported for importation. If PreviousModel is set, then this attribute must also be set. A good valid example for this is "v1", "v2", "v3", ...
Declaration
public string VersionString
Field Value
Type | Description |
---|---|
String |