Example #1
0
    public static void ChageType(Grid grid, GridType gridType)
    {
        switch (gridType)
        {
        case GridType.Wall:
            grid.currentType = GridType.Ground;
            squareGrid.RemoveWall(grid);
            grid.GetComponent <MeshRenderer>().material.color = Color.white;
            break;

        case GridType.Forest:
            grid.currentType = GridType.Wall;
            squareGrid.RemoveForest(grid);
            squareGrid.AddWall(grid);
            grid.GetComponent <MeshRenderer>().material.color = Color.yellow;
            break;

        case GridType.Ground:
            grid.currentType = GridType.Forest;
            squareGrid.AddForest(grid);
            grid.GetComponent <MeshRenderer>().material.color = Color.green;
            break;

        default:
            break;
        }
    }
Example #2
0
 private void GridView_WallRemoved(object sender, WallRemovedEventArgs e)
 {
     _nodeGrid.RemoveWall(e.X, e.Y);
     UpdateSearch();
     UpdateCurrentStepView();
 }