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 a group for tile instances - Unity Tutorial
From the course: Unity 5: 2D Building a Tile Map Editor
Creating a group for tile instances
- So now that our brush stays within the tile map itself, we're going to look at how to draw tiles into the map. You may have noticed that if you look inside of the tile map in the hierarchy view, that we have a brush game object. When we deselect the tile map, that goes away. When we reselect it, we create the new brush and now we could move it around. We're going to use the same principle for connecting our tiles. In this case, we're going to create a game object to act as a container for all the children tiles that will go in our tile map. Let's switch over to our tile map. Here we're going to want to keep a reference to the game object that contains all the tiles. We'll create a public field called tiles with a type of game object. Now, in the tile map editor we're going to need to create this whenever we call the on enable method of our editor. Now before we test that the map has a textured 2D, let's go ahead and create the tiles instance. We're going to test to see if the mapped…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.