Lynda.com: Become a Unity 2D Developer (Day 5)

UNITY 5: 2D BUILDING A TILE MAP EDITOR (...continued)

DRAWING THE MAP GRID

Creating the Title Map Outline

Below is the code used to create a tile grid within the Tile Map layer.  Also, I have provided a screenshot of the new grid itself.   It is important to note that height and width are still subjective.  If the x and y values are manipulated within the Unity GUI, it will override the scripted value(s).



Drawing a Tile Grid

With the Tile Map Outline, it has similar steps in concept.  However, there is definitely more going on code wise than the prior exercise.  Notice that a for loop was utilized in order to essentially divide the space evenly throughout the Tile Map.  Admittedly, the concept of Gizmos aren't completely over my head, I will need to investigate further.  For now, moving forward with the next lesson.


Updating the Grid Size

In regards to updating the grid size, this exercise was not the most thrilling experience, but I was able to receive some instant gratification.  Unlike before, when changing the X or Y values within the Tile Map Inspector window, it will now update the Grid Size in Units.

 





CREATING A TILE PICKER

Creating a Custom Window

This exercise was quite frustrating.  I was unable to get the script working as expected.  I followed the instructions to the letter, but somehow it still would not create the custom Tile Picker window.  Nevertheless, I have provided a screenshot of the code.  Unfortunately, I am unable to provide a successful execution screenshot. At this point, the mantra still stands, I'm moving forward.

Comments

Popular posts from this blog

JavaScript 30: JavaScript Drum Kit

Lynda.com: Become a Unity 2D Developer (Day 11..Sort of)

Back On the Coding Horse