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 custom window - Unity Tutorial
From the course: Unity 5: 2D Building a Tile Map Editor
Creating a custom window
- So at this point, we're able to resize our grid. We're calculating the correct grid size and tile size based on the pixels to units, and we already have a texture 2D. What we're going to want to do is build a window to be our tile picker. To get started, we're going to need to put a new script inside of our Editor folder. And we're going to call this TilePickerWindow. Then let's open this up in MonoDevelop. Just like before, we're going to need to import the Unity editor. This time, instead of extending the editor, we're going to extend a special class called the EditorWindow. We'll also delete the Start and Update methods, since we won't be using them. Now wer'e going to need another static method in order to create our window. And above it, just like before, we're going to make this a MenuItem. Now, if we save our script, and go back over to Unity, we should see it as an option in the Window. Here is our Tile Picker. Right now if you click it, it won't do anything, so let's add…
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.