Class AstarSerializer

Public

Handles low level serialization and deserialization of graph settings and data.

Mostly for internal use. You can use the methods in the AstarData class for higher level serialization and deserialization.

Public Methods

AstarSerializer (data, contextRoot)
Public
AstarSerializer (data, settings, contextRoot)
Public
CloseDeserialize ()
Public
CloseSerialize ()
Public
DeserializeEditorSettingsCompatibility ()

Deserializes graph editor settings.

Public
DeserializeExtraInfo ()

Deserializes extra graph info.

Public
DeserializeGraphs (availableGraphTypes)

Deserializes graph settings.

Public
GetChecksum ()
Public
OpenDeserialize (bytes)
Public
OpenSerialize ()
Public
PostDeserialization ()

Calls PostDeserialization on all loaded graphs.

Public
Serialize (graph)

Serializes the graph settings to JSON and returns the data.

Public
SerializeExtraInfo ()
Public
SerializeGraphs (_graphs)
Public
SetGraphIndexOffset (offset)
Public

Public Static Methods

LoadFromFile (path)

Load the specified data from the specified path.

Public Static
SaveToFile (path, data)

Save the specified data at the specified path.

Public Static

Public Static Variables

V3_8_3

Cached version object for 3.8.3.

Public Static Readonly
V3_9_0

Cached version object for 3.9.0.

Public Static Readonly
V4_1_0

Cached version object for 4.1.0.

Public Static Readonly
V4_3_12

Cached version object for 4.3.12.

Public Static Readonly
V4_3_2

Cached version object for 4.3.2.

Public Static Readonly
V4_3_37

Cached version object for 4.3.37.

Public Static Readonly
V4_3_6

Cached version object for 4.3.6.

Public Static Readonly

Private/Protected Members

AddChecksum (bytes)
Private
AddEntry (name, bytes)
Private
AnyDestroyedNodesInGraphs ()
Private
ContainsEntry (name)
Private
DeserializeBinaryMeta (entry)
Private
DeserializeExtraInfo (graph)
Private
DeserializeGraph (zipIndex, graphIndex, availableGraphTypes)
Private
DeserializeMeta (entry)
Private
DeserializeNodeLinks (int2Node)
DeserializeNodeReferenceMap ()
Private
DeserializeNodeReferences (graph, int2Node)
Private
FullyDefinedVersion (v)

Returns a version with all fields fully defined.

Private Static
GetBinaryReader (entry)

Returns a binary reader for the data in the zip entry.

Private Static
GetEntry (name)
Private
GetMaxNodeIndexInAllGraphs (graphs)
Private Static
GetString (entry)

Returns the data in the zip entry as a string.

Private Static
GetStringBuilder ()

Returns a cached StringBuilder.

Private Static
SerializeGraphExtraInfo (graph)

Serializes info returned by NavGraph.SerializeExtraInfo.

Private Static
SerializeGraphNodeReferences (graph)

Used to serialize references to other nodes e.g connections.

Private Static
SerializeMeta ()

Serialize metadata about all graphs.

Private
SerializeNodeIndices (graphs)
Private Static
SerializeNodeLinks ()
_stringBuilder

Cached StringBuilder to avoid excessive allocations.

Private Static
binaryExt

Extension to use for binary files.

Private Static
checksum

Checksum for the serialized data.

Private
contextRoot

Root GameObject used for deserialization.

Private
data
Private
encoding
Private
graphIndexInZip

Index used for the graph in the file.

Private
graphIndexOffset
Private
graphs

Graphs that are being serialized or deserialized.

Private
jsonExt

Extension to use for json files.

Private Static
meta

Graph metadata.

Private
settings

Settings for serialization.

Private
zip

Zip which the data is loaded from.

Private
zipStream

Memory stream with the zip data.

Private

Deprecated Members

SerializeNodes ()

Deprecated method to serialize node data.

Public