GetAllInRange() public static method

public static GetAllInRange ( Bounds b ) : List
b UnityEngine.Bounds
return List
Ejemplo n.º 1
0
        // Token: 0x06000738 RID: 1848 RVA: 0x000468DC File Offset: 0x00044CDC
        public void ForceUpdate()
        {
            if (this.handlers.Count == 0)
            {
                throw new Exception("Cannot update graphs. No TileHandler. Do not call this method in Awake.");
            }
            if (this.updateIndex >= this.handlers.Count - 1)
            {
                this.updateIndex = -1;
            }
            this.updateIndex++;
            this.lastUpdateTime = Time.realtimeSinceStartup;
            TileHandler       tileHandler = this.handlers[this.updateIndex];
            List <NavmeshCut> allInRange  = NavmeshCut.GetAllInRange(tileHandler.graph.forcedBounds);

            if (this.forcedReloadBounds.Count == 0)
            {
                int num = 0;
                for (int i = 0; i < allInRange.Count; i++)
                {
                    if (allInRange[i].RequiresUpdate())
                    {
                        num++;
                        break;
                    }
                }
                if (num == 0)
                {
                    ListPool <NavmeshCut> .Release(allInRange);

                    return;
                }
            }
            bool flag = tileHandler.StartBatchLoad();

            for (int j = 0; j < this.forcedReloadBounds.Count; j++)
            {
                tileHandler.ReloadInBounds(this.forcedReloadBounds[j]);
            }
            for (int k = 0; k < allInRange.Count; k++)
            {
                if (allInRange[k].enabled)
                {
                    if (allInRange[k].RequiresUpdate())
                    {
                        tileHandler.ReloadInBounds(allInRange[k].LastBounds);
                        tileHandler.ReloadInBounds(allInRange[k].GetBounds());
                    }
                }
                else if (allInRange[k].RequiresUpdate())
                {
                    tileHandler.ReloadInBounds(allInRange[k].LastBounds);
                }
            }
            for (int l = 0; l < allInRange.Count; l++)
            {
                if (allInRange[l].RequiresUpdate())
                {
                    allInRange[l].NotifyUpdated();
                }
            }
            ListPool <NavmeshCut> .Release(allInRange);

            if (flag)
            {
                tileHandler.EndBatchLoad();
            }
            this.forcedReloadBounds.Clear();
        }