From the course: Unity 5: 2D Building a Tile Map Editor

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Creating the title map outline

Creating the title map outline - Unity Tutorial

From the course: Unity 5: 2D Building a Tile Map Editor

Creating the title map outline

- So, now we're ready to actually draw the grid for our tile map in the scene view. In order to do that, we're going to use a Gizmo. Gizmos allow us to draw boxes and circles and other geometric shapes inside of the scene view that won't show up during the game. They're really good tools for visualizing stuff that you're doing inside the editor. Let's go back into our tile map, and we're going to add the code we need to draw the Gizmos. Below our update method, let's create a new, private method called OnDrawGizmoSelected, and then inside of this method, we're going to need to get a reference to the game object's transform position. Once we have this, we're going to want to test that the texture 2D is actually set, and if it is we're going to draw a border around the full size of our tile map. Below where we set the position, let's create the condition for testing the texture 2D. And inside of this, we're going to add the code for our Gizmo. The first thing we're going to do is tell…

Contents