IEnumerable<Progress>
ScanAsync
(
NavGraph[] | graphsToScan=null | The graphs to scan. If this parameter is null then all graphs will be scanned |
)
Scans all specified graphs asynchronously.
This is a IEnumerable, you can loop through it to get the progress
You can scan graphs asyncronously by yielding when you loop through the progress. Note that this does not guarantee a good framerate, but it will allow you to at least show a progress bar during scanning.
IEnumerator Start () {
foreach (Progress progress in AstarPath.active.ScanAsync()) {
Debug.Log("Scanning... " + progress.ToString());
yield return null;
}
}
NoteIf the graphs are already scanned, doing an async scan will temporarily cause increased memory usage, since two copies of the graphs will be kept in memory during the async scan. This may not be desirable on some platforms. A non-async scan will not cause this temporary increased memory usage.
A* Pro FeatureThis is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited.
The Pro version can be bought here