Backbone - Persistence
 
Loading...
Searching...
No Matches
Backbone::Vector3Converter Class Reference

Custom JSON converter for Unity's Vector3 type. Serializes and deserializes Vector3 values as individual x, y, and z components. More...

Inheritance diagram for Backbone::Vector3Converter:

Public Member Functions

override void WriteJson (JsonWriter writer, Vector3 value, JsonSerializer serializer)
 Writes the Vector3 to JSON using separate x, y, and z properties.
 
override Vector3 ReadJson (JsonReader reader, Type objectType, Vector3 existingValue, bool hasExistingValue, JsonSerializer serializer)
 Reads a Vector3 from JSON by parsing its x, y, and z components.
 

Detailed Description

Custom JSON converter for Unity's Vector3 type. Serializes and deserializes Vector3 values as individual x, y, and z components.

Member Function Documentation

◆ ReadJson()

override Vector3 Backbone::Vector3Converter::ReadJson ( JsonReader reader,
Type objectType,
Vector3 existingValue,
bool hasExistingValue,
JsonSerializer serializer )

Reads a Vector3 from JSON by parsing its x, y, and z components.

Parameters
readerThe JsonReader to read from.
objectTypeThe type of the object to create.
existingValueAn existing value if one exists.
hasExistingValueTrue if an existing value is provided.
serializerThe JsonSerializer instance.
Returns
The deserialized Vector3 value.

◆ WriteJson()

override void Backbone::Vector3Converter::WriteJson ( JsonWriter writer,
Vector3 value,
JsonSerializer serializer )

Writes the Vector3 to JSON using separate x, y, and z properties.

Parameters
writerThe JsonWriter to write to.
valueThe Vector3 value to serialize.
serializerThe JsonSerializer instance.

The documentation for this class was generated from the following file: