|
A* Pathfinding Project
3.0.9
The A* Pathfinding Project for Unity
|
Stores the navgraphs for the A* Pathfinding System. More...
Collaboration diagram for AstarData:| void | UpdateShortcuts () | ||
| void | Awake () | Loads the graphs from memory, will load cached graphs if any exists. | |
| void | LoadFromCache () | ||
| void | SaveCacheData (int mask) | ||
| byte[] | SerializeGraphs (AstarSerializer serializer) | Main serializer function, a similar one exists in the AstarEditor.cs script to save additional info. | |
| void | SerializeGraphsPart (AstarSerializer serializer) | Saves all graphs and also user connections, but does not close, nor opens the stream. | |
| void | DeserializeGraphs (AstarSerializer serializer) | Main deserializer function, loads from the #data variable. | |
| void | DeserializeGraphs (AstarSerializer serializer, byte[] bytes) | Main deserializer function, loads from bytes variable. | |
| void | DeserializeGraphsPart (AstarSerializer serializer) | Deserializes all graphs and also user connections. | |
| void | FindGraphTypes () | Find all graph types supported in this build. | |
| System.Type | GetGraphType (string type) | ||
| NavGraph | CreateGraph (string type) | Creates a new instance of a graph of type type. | |
| NavGraph | CreateGraph (System.Type type) | Creates a new graph instance of type type. | |
| NavGraph | AddGraph (string type) | Adds a graph of type type to the graphs array. | |
| NavGraph | AddGraph (System.Type type) | Adds a graph of type type to the graphs array. | |
| void | AddGraph (NavGraph graph) | Adds the specified graph to the graphs array. | |
| void | RemoveGraph (NavGraph graph) | Removes the specified graph from the graphs array and Destroys it in a safe manner. | |
| Node | GetNode (int graphIndex, int nodeIndex) | Returns the node at graphs[graphIndex].nodes[nodeIndex]. | |
| Node | GetNode (int graphIndex, int nodeIndex, NavGraph[] graphs) | Returns the node at graphs[graphIndex].nodes[nodeIndex]. | |
| NavGraph | FindGraphOfType (System.Type type) | Returns the first graph of type type found in the graphs array. | |
| IEnumerable | FindGraphsOfType (System.Type type) | Loop through this function to get all graphs of type 'type'. | |
| IEnumerable | GetUpdateableGraphs () | All graphs which implements the UpdateableGraph interface. | |
| IEnumerable | GetRaycastableGraphs () | All graphs which implements the UpdateableGraph interface. | |
| int | GetGraphIndex (NavGraph graph) | Gets the index of the NavGraph in the graphs array. | |
| int | GuidToIndex (System.Guid guid) | Tries to find a graph with the specified GUID in the graphs array. | |
| NavGraph | GuidToGraph (System.Guid guid) | Tries to find a graph with the specified GUID in the graphs array. |
| static NavGraph | GetGraph (Node node) | Returns the graph which contains the specified node. |
| NavMeshGraph | navmesh | Shortcut to the first NavMeshGraph. | |
| GridGraph | gridGraph | Shortcut to the first GridGraph. | |
| ListGraph | listGraph | Shortcut to the first ListGraph. | |
| System.Type[] | graphTypes = null | All supported graph types. | |
| NavGraph[] | graphs | All graphs this instance holds. | |
| UserConnection[] | userConnections | Links placed by the user in the scene view. | |
| bool | hasBeenReverted = false | Has the data been reverted by an undo operation. | |
| byte[] | data | ||
| byte[] | data_backup | ||
| byte[] | data_cachedStartup | ||
| bool | cacheStartup = false | ||
| bool | compress = false |
| AstarPath | active [get] |
Stores the navgraphs for the A* Pathfinding System.
An instance of this class is assigned to AstarPath::astarData, from it you can access all graphs loaded through graphs.
This class also handles a lot of the high level serialization.
| void Awake | ( | ) |
Loads the graphs from memory, will load cached graphs if any exists.
| NavGraph CreateGraph | ( | string | type | ) |
Creates a new instance of a graph of type type.
If no matching graph type was found, an error is logged and null is returned
| NavGraph CreateGraph | ( | System.Type | type | ) |
Creates a new graph instance of type type.
| void DeserializeGraphs | ( | AstarSerializer | serializer | ) |
Main deserializer function, loads from the #data variable.
| void DeserializeGraphs | ( | AstarSerializer | serializer, |
| byte[] | bytes | ||
| ) |
Main deserializer function, loads from bytes variable.
| void DeserializeGraphsPart | ( | AstarSerializer | serializer | ) |
Deserializes all graphs and also user connections.
| NavGraph FindGraphOfType | ( | System.Type | type | ) |
Returns the first graph of type type found in the graphs array.
Returns null if none was found
| IEnumerable FindGraphsOfType | ( | System.Type | type | ) |
Loop through this function to get all graphs of type 'type'.
foreach (GridGraph graph in AstarPath.astarData.FindGraphsOfType (typeof(GridGraph))) { //Do something with the graph }
| void FindGraphTypes | ( | ) |
Find all graph types supported in this build.
Using reflection, the assembly is searched for types which inherit from NavGraph.
Returns the graph which contains the specified node.
The graph must be in the graphs array.
| int GetGraphIndex | ( | NavGraph | graph | ) |
| System.Type GetGraphType | ( | string | type | ) |
Returns the node at graphs[graphIndex].nodes[nodeIndex].
All kinds of error checking is done to make sure no exceptions are thrown.
Returns the node at graphs[graphIndex].nodes[nodeIndex].
The graphIndex refers to the specified graphs array.
All kinds of error checking is done to make sure no exceptions are thrown
| IEnumerable GetRaycastableGraphs | ( | ) |
All graphs which implements the UpdateableGraph interface.
foreach (IRaycastableGraph graph in AstarPath.astarData.GetRaycastableGraphs ()) { //Do something with the graph }
| IEnumerable GetUpdateableGraphs | ( | ) |
| NavGraph GuidToGraph | ( | System.Guid | guid | ) |
Tries to find a graph with the specified GUID in the graphs array.
Returns null if none is found
| int GuidToIndex | ( | System.Guid | guid | ) |
Tries to find a graph with the specified GUID in the graphs array.
if one is found it returns its index, otherwise it returns -1
| void RemoveGraph | ( | NavGraph | graph | ) |
Removes the specified graph from the graphs array and Destroys it in a safe manner.
| byte [] SerializeGraphs | ( | AstarSerializer | serializer | ) |
Main serializer function, a similar one exists in the AstarEditor.cs script to save additional info.
| void SerializeGraphsPart | ( | AstarSerializer | serializer | ) |
Saves all graphs and also user connections, but does not close, nor opens the stream.
All graphs this instance holds.
This will be filled only after deserialization has completed
| System.Type [] graphTypes = null |
All supported graph types.
This should be identical throughout the project
| bool hasBeenReverted = false |
Has the data been reverted by an undo operation.
Used by the editor's undo logic to check if the AstarData has been reverted by an undo operation and should be deserialized
Shortcut to the first NavMeshGraph.
Updated at scanning time
Links placed by the user in the scene view.