Class Vector4Serializer
Type serializer for UnityEngine.Vector4 values. Writes and reads the four
single-precision floating-point components x, y, z, and w
as a JSON object with named properties. Unknown properties encountered during read are
silently skipped.
Inherited Members
Namespace: Scylla.Core.Util.Serialization
Assembly: ScyllaCore.dll
Syntax
public sealed class Vector4Serializer : TypeSerializerBase<Vector4>, ITypeSerializer<Vector4>, ITypeSerializer
Remarks
The serialized JSON format is {"x": float, "y": float, "z": float, "w": float}.
Missing component properties default to 0 on deserialization.
Use the shared Instance singleton rather than creating new instances;
Vector4Serializer carries no mutable state and is safe to share across threads.
Fields
Instance
Shared, reusable singleton instance of Vector4Serializer.
Prefer this over allocating a new instance wherever a Vector4Serializer is needed.
Declaration
public static readonly Vector4Serializer Instance
Field Value
| Type | Description |
|---|---|
| Vector4Serializer |
Methods
Read(IScyllaReader, ISerializationContext)
Reads a UnityEngine.Vector4 from the reader, populating components from a JSON
object's x, y, z, and w properties.
Declaration
public override Vector4 Read(IScyllaReader reader, ISerializationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IScyllaReader | reader | The reader positioned at the start of a JSON object. Never |
| ISerializationContext | context | The active serialization context. Never |
Returns
| Type | Description |
|---|---|
| Vector4 | The deserialized UnityEngine.Vector4. Any missing component defaults to |
Overrides
Write(Vector4, IScyllaWriter, ISerializationContext)
Writes a UnityEngine.Vector4 to the output as a JSON object containing the
x, y, z, and w float components.
Declaration
public override void Write(Vector4 value, IScyllaWriter writer, ISerializationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector4 | value | The UnityEngine.Vector4 to serialize. |
| IScyllaWriter | writer | The writer that receives the serialized output. Never |
| ISerializationContext | context | The active serialization context. Never |