From the course: Unity 5: 2D Level Design
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Add layers
- [Instructor] Now before we can start building our first layer, we're going to need to make one more modification to our Tile Map Editor. We're going to need to set a custom layer to each of the tiles we draw, this way, the aliens know when they're standing on solid ground. To get started, let's open up our TileMapEditor. First, let's import a new collection of classes. We'll type out using System.Collections.Generic; this will give us access to the list collection class, which has some advantages over the array. The biggest one being that you can dynamically change the size of the list based on what you put inside of it. Next, we're going to need to keep track of the name of the layer we want to assign to the tile. So let's create a string field, and call it layerName, we'll also set this to an empty string. Unfortunately, there isn't an easy way for us to get the layer names that we've created in our project. So, we're going to have to iterate through all the custom names and build…
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.