Exemplo n.º 1
0
        // Token: 0x060023C8 RID: 9160 RVA: 0x000C6824 File Offset: 0x000C4C24
        public void bakeNavigation()
        {
            float x = Flag.MIN_SIZE + this.width * (Flag.MAX_SIZE - Flag.MIN_SIZE);
            float z = Flag.MIN_SIZE + this.height * (Flag.MAX_SIZE - Flag.MIN_SIZE);

            if (!Level.info.configData.Use_Legacy_Ground)
            {
                this.graph.forcedBoundsCenter = new Vector3(this.point.x, 0f, this.point.z);
                this.graph.forcedBoundsSize   = new Vector3(x, Landscape.TILE_HEIGHT, z);
            }
            else if (Level.info.configData.Use_Legacy_Water && LevelLighting.seaLevel < 0.99f && !Level.info.configData.Allow_Underwater_Features)
            {
                this.graph.forcedBoundsCenter = new Vector3(this.point.x, LevelLighting.seaLevel * Level.TERRAIN + (Level.TERRAIN - LevelLighting.seaLevel * Level.TERRAIN) / 2f - 0.625f, this.point.z);
                this.graph.forcedBoundsSize   = new Vector3(x, Level.TERRAIN - LevelLighting.seaLevel * Level.TERRAIN + 1.25f, z);
            }
            else
            {
                this.graph.forcedBoundsCenter = new Vector3(this.point.x, Level.TERRAIN / 2f, this.point.z);
                this.graph.forcedBoundsSize   = new Vector3(x, Level.TERRAIN, z);
            }
            if (LevelGround.models2 != null)
            {
                LevelGround.models2.gameObject.SetActive(false);
            }
            AstarPath.active.ScanSpecific(this.graph);
            LevelNavigation.updateBounds();
            if (LevelGround.models2 != null)
            {
                LevelGround.models2.gameObject.SetActive(true);
            }
        }
Exemplo n.º 2
0
 public static void removeFlag(Transform select)
 {
     for (int i = 0; i < LevelNavigation.flags.Count; i++)
     {
         if (LevelNavigation.flags[i].model == select)
         {
             for (int j = i + 1; j < LevelNavigation.flags.Count; j++)
             {
                 LevelNavigation.flags[j].needsNavigationSave = true;
             }
             try
             {
                 LevelNavigation.flags[i].remove();
             }
             catch
             {
             }
             LevelNavigation.flags.RemoveAt(i);
             LevelNavigation.flagData.RemoveAt(i);
             break;
         }
     }
     LevelNavigation.updateBounds();
 }