Exemplo n.º 1
0
 private PathDrawer GetPathDrawer(Cell cell)
 {
     if (!pathDrawers.ContainsKey(cell))
     {
         pathDrawers.Add(cell, PathManager.CreatePathDrawer());
     }
     return(pathDrawers[cell]);
 }
Exemplo n.º 2
0
 void Start()
 {
     if (startCursorPrefab != null)
     {
         startCursorInstance = Instantiate <Transform>(startCursorPrefab, GridManager.GetCellPos(startCell), Quaternion.identity);
     }
     if (endCursorPrefab != null)
     {
         endCursorInstance = Instantiate <Transform>(endCursorPrefab, GridManager.GetCellPos(targetCell), Quaternion.identity);
     }
     previewPathDrawer = PathManager.CreatePathDrawer();
 }
Exemplo n.º 3
0
    private void SetPathForCell(Cell cell, List <Cell> path)
    {
        if (!pathDrawers.ContainsKey(cell))
        {
            pathDrawers.Add(startCell, PathManager.CreatePathDrawer());
        }
        if (!paths.ContainsKey(cell))
        {
            paths.Add(cell, path);
        }

        pathDrawers[cell].DrawPath(path);
        paths[cell] = path;
    }