public void DiscardPending()
    {
        ListView <NavmeshCut> all = NavmeshCut.GetAll();

        for (int i = 0; i < all.Count; i++)
        {
            if (all[i].RequiresUpdate())
            {
                all[i].NotifyUpdated();
            }
        }
    }
    private bool ShouldRebuildNav()
    {
        ListView <NavmeshCut> all = NavmeshCut.GetAll();

        if (this.forcedReloadBounds.Count != 0)
        {
            return(true);
        }
        for (int i = 0; i < all.Count; i++)
        {
            if (all[i].RequiresUpdate())
            {
                return(true);
            }
        }
        return(false);
    }
Example #3
0
    private void Rebuild2()
    {
        ListView <NavmeshCut> all      = NavmeshCut.GetAll();
        ListView <NavmeshCut> listView = new ListView <NavmeshCut>();

        this.CreateHandlers(all);
        if (this.handlers == null)
        {
            return;
        }
        AstarPath active = AstarPath.active;
        int       num    = active.astarData.graphs.Length + 1;

        for (int i = 0; i < all.Count; i++)
        {
            all[i].Check();
        }
        for (int j = 0; j < this.handlers.Length; j++)
        {
            listView.Clear();
            for (int k = 0; k < all.Count; k++)
            {
                NavmeshCut navmeshCut = all[k];
                if (navmeshCut.campIndex != j && navmeshCut.enabled)
                {
                    listView.Add(navmeshCut);
                }
            }
            this.handlers[j].ReloadTiles(listView);
            AstarData astarData = this.handlers[j].graph.astarData;
            astarData.RasterizeGraphNodes();
        }
        for (int l = 0; l < all.Count; l++)
        {
            if (all[l].RequiresUpdate())
            {
                all[l].NotifyUpdated();
            }
        }
        this.forcedReloadBounds.Clear();
    }
    private void Rebuild2()
    {
        ListView <NavmeshCut> all         = NavmeshCut.GetAll();
        ListView <NavmeshCut> navmeshCuts = new ListView <NavmeshCut>();

        this.CreateHandlers(all);
        if (this.handlers != null)
        {
            int num = AstarPath.active.astarData.graphs.Length + 1;
            for (int i = 0; i < all.Count; i++)
            {
                all[i].Check();
            }
            for (int j = 0; j < this.handlers.Length; j++)
            {
                navmeshCuts.Clear();
                for (int m = 0; m < all.Count; m++)
                {
                    NavmeshCut item = all[m];
                    if ((item.campIndex != j) && item.enabled)
                    {
                        navmeshCuts.Add(item);
                    }
                }
                this.handlers[j].ReloadTiles(navmeshCuts);
                this.handlers[j].graph.astarData.RasterizeGraphNodes();
            }
            for (int k = 0; k < all.Count; k++)
            {
                if (all[k].RequiresUpdate())
                {
                    all[k].NotifyUpdated();
                }
            }
            this.forcedReloadBounds.Clear();
        }
    }