> For the complete documentation index, see [llms.txt](https://ms-kb.msd.unimelb.edu.au/next-lab/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ms-kb.msd.unimelb.edu.au/next-lab/augmented-reality/guides/unity-and-vuforia-1/unity-primer.md).

# Unity Primer

## Installing Unity

{% embed url="<https://store.unity.com/download?ref=personal>" %}

1. Head to [unity3d.com](https://www.unity3d.com) and download the **relevant instance** of Unity.
2. Make sure you install the **necessary components,** particularly **Vuforia Augmented Reality Support** and the relevant packages for any particular platform you wish to develop for.

![Figure 1.0 - Make sure to install Vuforia Unity Components](/files/-LYZLtmO4JVhUm9rA5uh)

## Creating a Project

To create a new **Unity Project**, open **Unity** and select create a **New Local Project**. `Projects > On Disk > New Project`

![Figure 2.0 - Creating a new Unity Project](/files/-LYZswhZIZ49fYA4xze9)

**Asset Packages** can be added during this step based on the existing asset packages that have been previously downloaded.

![Figure 2.1 - Project Naming and Asset Packages](/files/-LYZtb7o_FHECqqMd_1z)

## User Interface

Once a project has been created, the main **Unity Interface** will be displayed.

The **Unity Interface** is comprised of **five main elements** shown below in Figure 3.0:

1. Toolbar
2. Hierarchy Window
3. Inspector Window
4. Project Window
5. Scene View

![Figure 3.0 - Unity Interface (UnityDocs)](/files/-LYUdItPZK8tomYxunrQ)

### The Toolbar

The **Toolbar** contains Unity's most important working features.&#x20;

![Figure 3.1 - The Unity Toolbar](/files/-LYUeiSGneW1X5cf0fqo)

* The **icons on the left** are used for **manipulating** both objects and t**he scene view**.&#x20;
* The **central controls** are used for **debugging** (playing) your scene.
* Similar to Adobe Cloud, the **right-hand dropdown menus** provide access to **different window layouts** or configurations and l**ayer visibility settings**.

### The Hierarchy Window

The **Hierarchy Window** lists all objects currently in the scene, and is used to show which objects are dependent upon others.

![Figure 3.2 - The Unity Hierarchy Window](/files/-LYUeecd97G3DxaQtkRd)

### The Inspector Window

The **Inspector Window** is located on the right of your screen and is generally used to display the properties of a selected object.

![Figure 3.3 - The Unity Inspector Window (Unity Docs)](/files/-LYUgtp6kIte7TwX9XIl)

![Figure 3.3.1 - The Unity Inspector Window's Other Functions](/files/-LYUeat7zLCE45A6dtsE)

In Figure 3.3, the inspector functions as a properties pane, with the ability to **perform transformations** on and **alter the properties** of particular **objects**, but usually this window can also also serve other functions. In Figure 3.3.1 the Unity Inspector **Window** serves as a **Tutorial Guide**.

### The Project Window

The **Project Window** is located at the **bottom** of the screen. It is generally used to display the **asset library** which are within a **project folder**.

![Figure 3.4 - The Unity Project Window](/files/-LYUeat6djM2gUvhY5Ub)

**Assets** should first be **loaded in to this project window prior to being dropped in to a scene**, so that the application is self-contained.

### The Scene View Window

The **Scene View Window** is a **representation of your scene**, and is located in the center of your display. The scene can be manipulated using the controls in the **top-right** of the **toolbar**.

![Figure 3.5 - The Unity Scene Window](/files/-LYUeat4o3Y9JHcF62n0)

The **scene view window** can be **either** a **2D** **or** **3D** rendering of a project, **depending on the type of project** being created.

## Understanding Unity Components

{% hint style="info" %}
This is a **Work in Progress Section** based on materials available on the [Unity Manual](https://docs.unity3d.com/Manual/).
{% endhint %}

### Scenes

Scenes contain the environments and menus of your game. Think of each unique **Scene** file as a unique level. In each **Scene**, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. Scenes can be created, saved and loaded like you would a file in the Project Window.&#x20;

#### Saving Scenes

Scenes need to be saved as well as Projects.&#x20;

To save the Scene you’re currently working on, choose **File** > **Save Scene** from the menu, or press Ctrl + S (Windows) or Cmd + S (masOS).

Unity saves Scenes as **Assets**\
&#x20;in your project’s *Assets* folder. This means they appear in the Project window, with the rest of your **Assets**.

### GameObjects

The **GameObject** is the most important concept in the Unity Editor.

Every object in your game is a **GameObject**, from characters and collectible items to lights, **cameras**\
&#x20;and special effects. However, a GameObject can’t do anything on its own; you need to give it properties before it can become a character, an environment, or a special effects by adding [components](https://docs.unity3d.com/Manual/Components.html)

A GameObject can contain any number of components. Unity has many built-in components, and you can create your own by writing C# scripts.

Depending on what kind of object you want to create, you add different combinations of components to a GameObject.

You can think of a GameObject as an empty cooking pot, and components as different ingredients that make up the recipe of your game. Unity has lots of different built-in component types, and you can also make your own components using the [Unity Scripting API](https://docs.unity3d.com/Manual/CreatingComponents.html).

This section explains how GameObjects, components and the Scripting API fit together, and how to create and use them.

### Assets

An asset is representation of any item that can be used in your game or project. An asset may come from a file created outside of Unity, such as a 3D model, an audio file, an image, or any of the other types of file that Unity supports. There are also some asset types that can be created within Unity, such as an **Animator Controller**, an Audio Mixer or a **Render Texture**\
.

![Some of the asset types that can be imported into Unity](https://docs.unity3d.com/uploads/Main/AssetWorkflowImportingFiles.png)

## Building Applications

{% hint style="info" %}
This is a **Work in Progress Section** based on materials available on the [Unity Manual](https://docs.unity3d.com/Manual/).
{% endhint %}

### iOS

{% embed url="<https://unity3d.com/learn/tutorials/topics/mobile-touch/building-your-unity-game-ios-device-testing?playlist=17138>" %}

### Android Devices

{% embed url="<https://unity3d.com/learn/tutorials/topics/mobile-touch/building-your-unity-game-android-device-testing?playlist=17138>" %}

### Microsoft HoloLens

{% embed url="<https://library.vuforia.com/content/vuforia-library/en/articles/Training/Developing-Vuforia-Apps-for-HoloLens.html>" %}

## Other Resources

{% embed url="<https://unity3d.com/learn/tutorials/>" %}

{% embed url="<https://docs.unity3d.com/Manual/>" %}
