A* Pathfinding Project
3.1.4
The A* Pathfinding Project for Unity 3D
|
Classes | |
struct | BitMask |
class | SMask |
Serializer mask for what is to be saved in the file. More... | |
Public Types | |
enum | SerializerError { Nothing, WrongMagic, WrongVersion, DoesNotExist } |
Public Member Functions | |
AstarSerializer (AstarPath script) | |
void | AddAnchor (string name) |
virtual void | AddUnityReferenceValue (string key, UnityEngine.Object value) |
Serializes a Unity Reference. | |
void | AddValue (string key, System.Object value) |
Serializes value with key and value. | |
void | AddVariableAnchor (string name) |
void | Close () |
byte[] | Compress (byte[] bytes) |
byte[] | DeCompress (byte[] bytes) |
delegate void | DeSerializationInterrupt (AstarSerializer serializer, bool newer, Guid guid) |
void | DeserializeAnchors () |
void | DeSerializeEditorSettings (NavGraph graph, ISerializableGraphEditor editor, AstarPath active) |
void | DeserializeNodes (NavGraph graph, NavGraph[] graphs, int graphIndex, AstarPath active) |
Deserializes nodes in the graph. | |
AstarSerializer | DeserializeSerializationInfo () |
Deserializes serialization info. | |
void | DeSerializeSettings (NavGraph graph, AstarPath active) |
virtual UserConnection[] | DeserializeUserConnections () |
Deserializes links placed by the user. | |
System.Object | GetDefaultValue (Type type) |
Returns the default value for the given type. | |
virtual UnityEngine.Object | GetUnityReferenceValue (string key, Type type, UnityEngine.Object defaultValue=null) |
Deserializes a Unity Reference. | |
System.Object | GetValue (string key, Type type, System.Object defaultValue=null) |
Deserializes a variable with key of the specified type. | |
void | InitializeSerializeNodes () |
byte[] | LoadFromFile (string path) |
bool | MoveToAnchor (string name) |
bool | MoveToVariableAnchor (string name) |
AstarSerializer | OpenDeserialize (byte[] data) |
Opens a deserialization session. | |
void | OpenSerialize () |
This is intended for quick saving of settings for e.g Undo operations. | |
delegate UnityEngine.Object | ReadUnityReference_Editor (AstarSerializer serializer, string name, int instanceID, System.Type type) |
void | SaveToFile (string path, byte[] data) |
void | SerializeAnchors () |
void | SerializeEditorSettings (NavGraph graph, ISerializableGraphEditor editor, AstarPath active) |
void | SerializeNodes (NavGraph graph, AstarPath active) |
Serializes the nodes in the graph. | |
void | SerializeSerializationInfo () |
void | SerializeSettings (NavGraph graph, AstarPath active) |
Called to serialize a graphs settings. | |
virtual void | SerializeUserConnections (UserConnection[] userConnections) |
Serializes links placed by the user. | |
void | SetUpGraphRefs (NavGraph[] graphs) |
void | Sort (int[] a, byte[] b) |
void | WriteError () |
delegate void | WriteUnityReference_Editor (AstarSerializer serializer, UnityEngine.Object ob) |
Static Public Member Functions | |
static AstarSerializer | GetDeserializer (Version version, AstarPath script) |
static string | StripPathOfFolder (string path, string relativeFolder) |
Makes path relative to the folder relativeFolder when relativeFolder exists in path. | |
static void | TestLoadFile (string path) |
Public Attributes | |
AstarPath | active |
Dictionary< string, int > | anchors |
AstarData | astarData |
bool | compress = true |
int | counter |
SerializerError | error = SerializerError.Nothing |
int[] | graphRefGuids |
The indices to the graphs in the new AstarData. | |
string[] | loadedGraphGuids |
The GUIDs of the graphs saved with the file (only set in load) | |
BitMask | mask = -1 & ~(SMask.SaveNodes) |
Mask for what to save. | |
bool | onlySaveSettings = false |
int | positionAtCounter = -1 |
long | positionAtError = -1 |
byte | prefix = 0 |
BinaryReader | readerStream |
bool | replaceOldGraphs = true |
Hashtable | serializedData |
Dictionary< string, int > | serializedVariables = new Dictionary<string, int> () |
Key, position. | |
string | sPrefix = "" |
Prefix to use before variables. | |
BinaryWriter | writerStream |
Static Public Attributes | |
static bool | IgnoreVersionDifferences = false |
Should version differences be ignored. | |
static ReadUnityReference_Editor | readUnityReference_Editor = null |
static WriteUnityReference_Editor | writeUnityReference_Editor = null |
Private Member Functions | |
void | DeSerializeNode (Node node, NavGraph[] graphs, int graphIndex, BinaryReader stream) |
Deserializes one node from the stream into the specified graphs and to the specified graph index. | |
void | SerializeNode (Node node, BinaryWriter stream) |
Serializes one node to the stream. | |
Private Attributes | |
List< int > | tmpConnectionCosts |
List< Node > | tmpConnections |
|
virtual |
Serializes a Unity Reference.
Serializer references such as Transform, GameObject, Texture or other unity objects
Reimplemented in AstarSerializer3_07.
Deserializes one node from the stream into the specified graphs and to the specified graph index.
Deserializes nodes in the graph.
The deserialized nodes will be created using graph.CreateNodes (numberOfNodes).
AstarSerializer DeserializeSerializationInfo | ( | ) |
Deserializes serialization info.
Deserializes Version, mask and loadedGraphGuids
|
virtual |
Deserializes a Unity Reference.
Deserializes references such as Transform, GameObject, Texture or other unity objects
Reimplemented in AstarSerializer3_07.
AstarSerializer OpenDeserialize | ( | byte[] | data | ) |
Opens a deserialization session.
This function returns an AstarSerializer, it will usually be the same as called on, but when loading from older graphs, it will have been replaced by another one.
Use the returned AstarSerializer from now on
|
private |
Serializes one node to the stream.
Serializes the nodes in the graph.
Called to serialize a graphs settings.
|
static |
Makes path relative to the folder relativeFolder when relativeFolder exists in path.
A path folder1/someFolder/testingFolder/myPic.png with relativeFolder = "someFolder" would become testingFolder/myPic.png
Returns "" (empty string) if the path didn't contain relativeFolder
int [] graphRefGuids |
The indices to the graphs in the new AstarData.
Conversion from loaded indices (newGraphIndex = graphRefGuids[oldGraphIndex])
|
static |
Should version differences be ignored.
This should not be enabled if you don't know what you are doing. It will enable older version of the project to try open files saved with a newer project version
BitMask mask = -1 & ~(SMask.SaveNodes) |
Mask for what to save.
The first 4 bits in this mask is used, the rest can be used to pass information on what was saved in the file *Assign values with += or |=, and remove them with -= or &= ~value Values should be one bit values (unless you know what you are doing), such as 1 << 20
string sPrefix = "" |
Prefix to use before variables.
Used to avoid name collisions