The GridManager class does a lot of the heavy lifting in terms of arranging and visualizing our grid. Compared to some of the code we've seen so far in this book, it's a fairly lengthy class, since it provides several helper methods. Pop open the GridManager.cs class to follow along:
[SerializeField] private int numberOfRows = 20; [SerializeField] public int numberOfColumns = 20; [SerializeField] public float gridCellSize = 2; [SerializeField] public bool showGrid = true; [SerializeField] public bool showObstacleBlocks = true; private Vector3 origin = new Vector3(); private GameObject[] obstacleList; private Node[,] nodes { get; set; }
We start off by setting up some variables. We specify how many rows and columns ...