Chapter 2: Main Menu Bar/File

Lesson 2: Main Menu Bar/File

We’re going to look at Unity’s “Main Menu Bar.” In this lesson we’ll learn of Unity’s three most important file and folder types; “Project, Scene, and Package.” Crucially, we’ll learn which to use when and why. We will create a Project and a Scene. Briefly, we’ll examine building a Project to a game.

Fig. 2.1 illustrates the Unity interface w/ File drop-down menu exposed

I trust you know how to create an account at unity3d.com and can download and install Unity Hub. Unity Hub helps you to manage multiple Projects (games) across potentially different versions of Unity, and manage and account for those different versions of Unity as well. Previously there was no real way to tell what version of Unity a Project was being developed in. This could have dire consequences as opening an old Project in a new version of Unity would sometimes cause critical, Project ending errors! Unity Hub also streamlines the process of downloading and installing dependencies such as platform specific SDKs. Previously developers might have had to go searching the net and creating multiple new accounts to find all the proper dependencies, if they even realized that they needed them in the first place! For these reasons and more, Unity Hub is a welcome addition to the Unity development process.

When run, we are greeted with the Unity Hub Window. Along the side you are provided the choices Projects, Learn, and Installs. Since, in my humble opinion, you are using the best learning materials available as we speak, we can narrow our interest to Projects and Installs. And since you don’t have any Projects, let’s select Installs.

Life moves at you fast. As do Unity versions. If you don’t stop and look at them once in awhile, you might miss out on some great new features! Under Installs you can locate and access all of your Unity installations. Since you don’t have any yet, let’s download and install one. On the right, select ADD. In the resulting window you can select the latest version or, to make sure everything matches with this course, select Unity 2019.2.8.f1 and then NEXT. Another window will appear, instructing you to Add components to your install. Since we will only be building to the Android platform, we can un-check everything but Android Build Support and Documentation. If you expand the Android Build Support selection by clicking the angle bracket, you’ll see that the installation kindly includes the necessary SDK and NDK tools. To be on the safe side, and since it only takes up 70.5MB of space, select OpenJDK too. Click NEXT.

Another window will appear asking you to agree to Google’s Licensing terms. Read them carefully. If you agree with the terms, check the box accordingly and click Done. Respond to any other prompts and be prepared to wait as Unity downloads.

Once it’s done downloading, three dots (a menu icon) appear where the download status bar was. Clicking it elicits Add Component (in case you missed any addons during the “Add Components to your install” phase), Set as preferred (always backup all your Projects before setting a newer version or Unity as default), and Uninstall.

Click on Projects and stay “On Disk.” Log into your account in the upper right hand corner if you are not logged in already. Click “New” to create a new Project. New fields appear: Project name, Location, Organization, and Template. You also have the option to “Add Asset Package” now or later, and the option to “Enable Unity Analytics.” In the Unity Version field, select which version of Unity you want to use (again, this book uses version 2019.2). When the time comes, Project Name should be the same as your game’s but for now let’s name it “test.” You can save the Project wherever you’d like, but best practices dictate that you save it to a second physical hard drive independent of your computer’s Operating System. Select an Organization; the remaining defaults are OK, so go ahead and select “Create Project.”

This is Unity, this is home! Along the top you’ll see what looks to be a very standard “Main Menu Bar.” And in many ways it is, but don’t be fooled, there is a lot of powerful functionality in this main menu bar and some things in it that are absolutely essential to know and understand. For example, if you click on “File,” you’ll see a lot of reference to “Scenes” and “Projects.” It’s really important to understand what Scenes and Projects are and how they relate to each other. One way to think of Scene and Project is that Scene is a level within a game and Project is the game itself. Simultaneously think of Scene as a file (with the extension .unity) and Project as a folder. Your game should be your Project’s name and will wind up being the name of your folder (and vice-versa). Once this folder has been created through the Project (creation) Wizard, Unity will propagate additional folders throughout. It’s important that you not drag and drop files in and out of the Project folders in the OS as it may wind up confusing Unity. The Unity engine adds metadata to the files and folders it creates to keep track of everything and to keep everything in its right place. To reiterate; Scene is a game level and a file. Project is the game and a folder system. Don’t move your game’s files about in the Operating System. Always do so in Unity.

One thing we’re not really seeing yet, but is worth mentioning now, is the file type “Package.” Along with Scene and Project, Package completes the trinity of Unity file and folder types. Package is Unity’s proprietary compressed file format (with the extension .unityPackage). It is very much like a .zip or .rar except that it contains metadata unique to Unity. It allows you to import and export individual assets or entire Projects while retaining their hierarchical relationships and cross-references. Playmaker, as well as other Unity asset store assets, are sold as .unityPackage files. Projects and Scenes should be shared as .unityPackages. Projects should be backed up as .unityPackages.

We already have a Project and Scene created so from here on out, you’ll be primarily opening and saving Scenes. “Save Project” saves all unsaved modifications to any asset in your Project folder to disk. This also automatically happens when you close Unity. For that reason, there really isn’t a need to save Projects and opening anything other than the most recent Project will load without a Scene (no matter how many times you experience this, seeing a Project open devoid of its carefully crafted Scenes will cause you to panic). Each level should be created as a new Scene, e.g. SceneName1, SceneName2, and SceneName3 correspond to Level1, Level 2, Level 3, etc.,… Any iterations of a level should be saved as Scenes, e.g. SceneName1, SceneName1a, SceneName1b,… You’ll wind up with many Scenes, but you don’t want to have multiple Project files for the same game. You should only, typically, have one Project per game title.

Further along the File menu drop-down is “Build Settings.” Select it to open the Build Settings Window.

Fig. 2.3 shows the Build Settings Window

“Build” processes your Project into a game people can install or otherwise access and play. We’ll look at Build settings briefly now. You’ll see you have a variety of platforms to select from. Some of these platforms will require additional licenses. In certain instances, you will be required to build (not necessarily create) your game from within a specific Operating System. Many of these platforms require the installation of additional modules (often proprietary SDKs) to facilitate a build.

The list of supported devices is ever growing- and ever changing. In addition to supporting new platforms, Unity will often discontinue support for older and unpopular devices.

Again, this is one of the killer features of Unity, the ability to build to many different platforms with the push of a button. Previously publishing to a different platform meant recreating your game very nearly from scratch in a different engine. Here you just select the platform and click “Switch Platform.” Notice that the top of this window, “Scenes In Build” is empty. You will have to load each Scene and click “Add Open Scene” for them to be included as part of the game. The levels will load in-game in the order that they are listed. Be sure to rearrange them into the intended order by dragging them around. You can see a few options here and many more open in the Inspector View when we click on Player Settings. Note now that this means the inspector is contextual. What it has to offer in terms of inspection will vary with what is selected. Most of the time you’ll be inspecting game objects, but it can be used to inspect elements of the game engine itself. Next to that you can load images for the app’s icon, name the game, define default resolutions, and so on. We are, however, getting ahead of ourselves. We’ll look at Build Settings more thoroughly once we’ve finished our game.

“Build and Run” assumes your settings are as you like. Unity then builds the Project. It runs the resulting game straightaway.

Exit” does exactly that and provides us with a nice segue with which to end this lesson.

In this lesson we learned of the trinity of Unity file and folder types; Project, Scene, and Package. We learned that Scene is both a file and a level within the game. Project is a folder and the game itself. Iterative development is saved as Scenes, there typically isn’t a need to save Projects. You should only have one Project per game title. Packages are Unity’s proprietary compressed file format and contain necessary metadata. Unity Projects should be shared and backed-up as Packages. A “build” turns your Unity Project into a game people can install or otherwise access and play. Unity allows you to build to many different computers, consoles, and mobile devices. In the next lesson we’ll look at the Edit menu.

Leave Comment

Your email address will not be published. Required fields are marked *