Ejemplo n.º 1
0
 public void LoadAllTiles()
 {
     for (int y = 0; y < 64; y++)
     {
         for (int x = 0; x < 64; x++)
         {
             if (!File.Exists(GetTilePath(x, y)))
             {
                 continue;
             }
             DetourMesh.LoadTile(x, y);
         }
     }
 }
Ejemplo n.º 2
0
        public bool LoadAppropriateTiles(Vector3 start, Vector3 end)
        {
            const int extent = 3;

            bool failed = false;
            int  tx, ty;

            // Start
            GetTileByLocation(start, out tx, out ty);
            for (int y = ty - extent; y <= ty + extent; y++)
            {
                for (int x = tx - extent; x <= tx + extent; x++)
                {
                    if (!DetourMesh.LoadTile(x, y))
                    {
                        failed = true;
                    }
                    Log.WriteLine("{0},{1}: {2}", x, y, failed);
                }
            }

            // End
            GetTileByLocation(end, out tx, out ty);
            for (int y = ty - extent; y <= ty + extent; y++)
            {
                for (int x = tx - extent; x <= tx + extent; x++)
                {
                    if (!DetourMesh.LoadTile(x, y))
                    {
                        failed = true;
                    }
                    Log.WriteLine("{0},{1}: {2}", x, y, failed);
                }
            }

            return(!failed);
        }