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, [settings], contextRoot)
DeserializeGraphs (availableGraphTypes)

Deserializes graph settings.

OpenDeserialize (bytes)

Calls PostDeserialization on all loaded graphs.

Serialize (graph)

Serializes the graph settings to JSON and returns the data.

SerializeGraphs (_graphs)

Public Static Methods

LoadFromFile (path)

Load the specified data from the specified path.

SaveToFile (path, data)

Save the specified data at the specified path.

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
V4_3_68

Cached version object for 4.3.68.

Public Static Readonly
V4_3_74

Cached version object for 4.3.74.

Public Static Readonly
V4_3_80

Cached version object for 4.3.80.

Public Static Readonly
V4_3_83

Cached version object for 4.3.83.

Public Static Readonly
V4_3_85

Cached version object for 4.3.85.

Public Static Readonly
V4_3_87

Cached version object for 4.3.87.

Public Static Readonly
V5_1_0

Cached version object for 5.1.0.

Public Static Readonly
V5_2_0

Cached version object for 5.2.0.

Public Static Readonly

Private/Protected Members

AddChecksum (bytes)
AddEntry (name, bytes)
ContainsEntry (name)

Deserializes graph editor settings.

DeserializeGraph (zipIndex, graphIndex, availableGraphTypes)
DeserializeMeta (entry)
DeserializeNodeReferences (graph, int2Node)

Returns a version with all fields fully defined.

GetBinaryReader (entry)

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

GetEntry (name)
GetString (entry)

Returns the data in the zip entry as a string.

Returns a cached StringBuilder.

SerializeGraphExtraInfo (graph, persistentGraphs)

Serializes info returned by NavGraph.SerializeExtraInfo.

SerializeGraphNodeReferences (graph, persistentGraphs)

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

Serialize metadata about all graphs.

_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
persistentGraphs
Private
settings

Settings for serialization.

Private
zip

Zip which the data is loaded from.

Private
zipStream

Memory stream with the zip data.

Private