示例#1
0
 void GetStartGoal2()
 {
     start   = new TmGrid();
     start.x = 20;
     start.z = 30;
     goal    = new TmGrid();
     goal.x  = 60;
     goal.z  = 30;
     UpdateStartGoal();
     iscan = true;
 }
示例#2
0
 void TestPaths()
 {
     Paths = SoulerItem.GetComponent <TmAstarComponent>().paths;
     if (Paths != null && Paths.Count > 0 && iscan)
     {
         Console.WriteLine(Paths.Count);
         for (int i = 0; i < 5; i++)
         {
             TmGrid grid = (TmGrid)Paths[i];
             Console.WriteLine("(x,z): " + grid.x + " , " + grid.z);
         }
         iscan = false;
     }
 }
示例#3
0
 void GetGrids()
 {
     grids = new TmGrid[100, 100];
     for (int i = 0; i < grids.GetLength(0); i++)
     {
         for (int j = 0; j < grids.GetLength(1); j++)
         {
             grids[i, j]   = new TmGrid();
             grids[i, j].x = j;
             grids[i, j].z = i;
             if (j == 40 && i < 50 && i > 10)
             {
                 grids[i, j].bObstacle = true;
             }
         }
     }
 }