Join Jesse Freeman for an in-depth discussion in this video Changing colors on the grid, part of Unity 5 2D: Pathfinding.
- Now we're going to need a way to change the color…of the images inside of our grid UI object.…Let's switch back over to our Pathfinding test after start.…Now let's create a private method that'll return an image…and we'll call it get image.…We're going to pass it in a string called label.…Here we're going to use the label from a node…to find the actual image inside of the grid.…In order to do that, we're going to have to convert…the label to a number.…Now, before we can convert this label into a number,…we're going to have to import the system namespace.…
So at the top of our class, let's add that.…Now, inside of our GetImage method,…let's create a new variable called id…and we'll use Int32 to Parse the label.…Next we're going to need to get a reference…of the game object itself.…Now let's create a variable for the game object…we'll need to get.…We'll call it go and we'll use the mapGroups transform child…we'll supply in the id that we just created…and then from that transform, we'll get a reference…to its gameObject.…
- What is A*?
- Adding node classes and properties
- Storing and indexing graph nodes
- Building the search class
- Traversing the nodes
- Searching adjacent nodes
- Testing the search
- Building a test map
- Creating and coloring a grid