Class Vector3IntSerializer
Type serializer for UnityEngine.Vector3Int values. Writes and reads the three 32-bit
integer components x, y, and z 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 Vector3IntSerializer : TypeSerializerBase<Vector3Int>, ITypeSerializer<Vector3Int>, ITypeSerializer
Remarks
The serialized JSON format is {"x": int, "y": int, "z": int}. Missing component
properties default to 0 on deserialization.
Use the shared Instance singleton rather than creating new instances;
Vector3IntSerializer carries no mutable state and is safe to share across threads.
Fields
Instance
Shared, reusable singleton instance of Vector3IntSerializer.
Prefer this over allocating a new instance wherever a Vector3IntSerializer is needed.
Declaration
public static readonly Vector3IntSerializer Instance
Field Value
| Type | Description |
|---|---|
| Vector3IntSerializer |
Methods
Read(IScyllaReader, ISerializationContext)
Reads a UnityEngine.Vector3Int from the reader, populating components from a JSON
object's x, y, and z properties.
Declaration
public override Vector3Int 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 |
|---|---|
| Vector3Int | The deserialized UnityEngine.Vector3Int. Any missing component defaults to |
Overrides
Write(Vector3Int, IScyllaWriter, ISerializationContext)
Writes a UnityEngine.Vector3Int to the output as a JSON object containing the
x, y, and z integer components.
Declaration
public override void Write(Vector3Int value, IScyllaWriter writer, ISerializationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3Int | value | The UnityEngine.Vector3Int to serialize. |
| IScyllaWriter | writer | The writer that receives the serialized output. Never |
| ISerializationContext | context | The active serialization context. Never |