|
1 | 1 | This document describes how to prepare the HoloToolkit sourcecode for use |
2 | 2 | in your project. |
3 | 3 |
|
4 | | -# Preparing the HoloToolkit-Unity Code |
| 4 | +To get started either download the HoloToolkit-Unity Asset Package or grab a copy of this repository and download the entire project. |
5 | 5 |
|
6 | | -We'll build the HoloToolkit from source since it's a reasonable assumption |
7 | | -that you want the latest and greatest if you are reading this document. To |
8 | | -do this you need to clone the GitHUb repository at |
| 6 | +# 1a. Download a HoloToolkit-Unity Asset Package |
| 7 | +You can download the latest unity package from [Releases](https://github.com/Microsoft/HoloToolkit-Unity/releases) folder |
| 8 | + |
| 9 | +[Continue to step 2](/GettingStarted.md#2-using-holotoolkit-unity-in-your-project) |
| 10 | + |
| 11 | +# 1b. Preparing the HoloToolkit-Unity Code |
| 12 | + |
| 13 | +If you'd like to build the HoloToolkit from the source, you'll need to clone the GitHub repository at |
9 | 14 | https://github.com/Microsoft/HoloToolkit-Unity.git. If you've never cloned a |
10 | 15 | repo before then you should consider using the GitHub desktop client, see |
11 | 16 | https://desktop.github.com/. |
12 | 17 |
|
13 | | -# Preparing to use the HoloToolkit-Unity package |
| 18 | +# 1c. Preparing to use the HoloToolkit-Unity package |
14 | 19 |
|
15 | 20 | Open the folder you just cloned in Unity. |
16 | 21 |
|
17 | 22 | Now, inside of Unity ensure you have the Assets folder selected in the project view, and export the package. **IMPORTANT:** Make sure you select the root Assets folder in the Project. It contains important .rsp files like csc, gmcs and smcs. |
18 | 23 |
|
19 | 24 | `Assets -> Export Package…` |
20 | 25 |
|
21 | | -# Using HoloToolkit-Unity in Your Project |
| 26 | +# 2. Using HoloToolkit-Unity in Your Project |
22 | 27 |
|
23 | 28 | Open or create your project in Unity. |
24 | 29 |
|
25 | 30 | `Assets -> Import Package -> Custom Package…` [Navigate to the package |
26 | | -you exported above]. **NOTE**: The HoloToolkit-Examples folder (and all its content and subfolders) is optional when you import the custom package. You can uncheck it in the **Import Unity Package** window that shows all the contents of the package before performing the import. |
| 31 | +you have either downloaded or exported above]. **NOTE**: The HoloToolkit-Examples folder (and all its content and subfolders) is optional when you import the custom package. You can uncheck it in the **Import Unity Package** window that shows all the contents of the package before performing the import. |
27 | 32 |
|
28 | 33 | You should now have a `HoloToolkit` menu item. |
29 | 34 |
|
30 | | -# Preparing a Scene for Holographic Content |
| 35 | +`HoloToolkit -> Configure -> Apply HoloLens Scene Settings` |
31 | 36 |
|
32 | | -Remove the default camera in the project (the next step creates a camera |
33 | | - customized for holographic development). |
| 37 | +# 3. Preparing a Scene for Holographic Content |
| 38 | +Create a new Scene: `File -> New Scene` |
34 | 39 |
|
35 | | -Add the `Main Camera.prefab` (found under HoloToolkit/Utilities/Prefabs). |
| 40 | +Remove the default `Main Camera` and `Directional Light` objects in the scene. |
36 | 41 |
|
37 | | -You will probably want to add `ManualCameraControl.cs` (found under |
38 | | - HoloToolkit/Utilities/Scripts) to the |
39 | | -`Main Camera`. This allows the user to manually control |
40 | | - the camera when in the Unity player. |
| 42 | +Add the `HoloLensCamera.prefab` (found under HoloToolkit/Input/Prefabs). |
41 | 43 |
|
42 | | -`HoloToolkit -> Configure -> Apply HoloLens Scene Settings` |
| 44 | +Add the `DefaultCursor.prefab` (found under HoloToolkit/Input/Prefabs/Cursor). |
| 45 | + |
| 46 | +Create an empty object in your scene and make sure its transform is zeroed on the origin. |
| 47 | +Rename it 'Managers'. |
43 | 48 |
|
44 | | -`HoloToolkit -> Configure -> Apply HoloLens Project Settings` |
| 49 | +Add the `InputManager.prefab` (found under HoloToolkit/Input/Prefabs) as a child to your new 'Managers' Object. |
45 | 50 |
|
46 | | -# Building Your Project for HoloLens |
| 51 | +Add an `Event System` to your scene by right click on 'Managers' object in your scene Hierarchy: `UI -> Event System`. |
| 52 | + |
| 53 | +Optionally, if you wish to enable spatial mapping in your scene, you can add the `SpatialMapping.prefab` (found under HoloToolkit/SpatialMapping/Prefabs) to your 'Managers' object. Be aware that you must also enable `Spatial Perception` Capabilities: `Edit/Project Settings/Player -> Inspector -> Publishing Settings/Capabilities`. |
| 54 | + |
| 55 | +# 4. Building Your Project for HoloLens |
47 | 56 |
|
48 | 57 | `HoloToolkit -> Build Window -> Build Visual Studio SLN` |
49 | 58 |
|
50 | 59 | `Open SLN` |
51 | 60 |
|
52 | 61 | Deploy to the emulator or device. |
53 | 62 |
|
54 | | -# Deploying your HoloLens app using Visual Studio |
| 63 | +# 5. Deploying your HoloLens app using Visual Studio |
55 | 64 | 1. Select **x86** in your build configuration |
56 | 65 | 2. Select emulator or the device that you're using |
57 | 66 | 3. Run the app |
58 | | - |
59 | | - |
60 | | - |
|
0 commit comments