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
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
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

Private/Protected Members

AddChecksum (bytes)
Private
AddEntry (name, bytes)
Private
AnyDestroyedNodesInGraphs ()
Private
ContainsEntry (name)
Private
DeserializeAndRemoveOldNodeLinks (ctx)
DeserializeBinaryMeta (entry)
Private
DeserializeEditorSettingsCompatibility ()

Deserializes graph editor settings.

Private
DeserializeExtraInfo (graph)
Private
DeserializeExtraInfo ()

Deserializes extra graph info.

Private
DeserializeGraph (zipIndex, graphIndex, availableGraphTypes)
Private
DeserializeMeta (entry)
Private
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, persistentGraphs)

Serializes info returned by NavGraph.SerializeExtraInfo.

Private Static
SerializeGraphNodeReferences (graph, persistentGraphs)

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

Private Static
SerializeMeta ()

Serialize metadata about all graphs.

Private
SerializeNodeIndices (graphs)
Private Static
_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

Deprecated Members

SerializeNodes ()

Deprecated method to serialize node data.

Public