Exemple #1
0
    private IEnumerable <Progress> ScanGraph(NavGraph graph)
    {
        if (AstarPath.OnGraphPreScan != null)
        {
            yield return(new Progress(0f, "Pre processing"));

            AstarPath.OnGraphPreScan(graph);
        }
        yield return(new Progress(0f, ""));

        foreach (Progress progress in graph.ScanInternal())
        {
            yield return(new Progress(Mathf.Lerp(0f, 0.95f, progress.progress), progress.description));
        }
        IEnumerator <Progress> enumerator = null;

        yield return(new Progress(0.95f, "Assigning graph indices"));

        graph.GetNodes(delegate(GraphNode node)
        {
            node.GraphIndex = graph.graphIndex;
        });
        if (AstarPath.OnGraphPostScan != null)
        {
            yield return(new Progress(0.99f, "Post processing"));

            AstarPath.OnGraphPostScan(graph);
        }
        yield break;
        yield break;
    }