Useful common concepts that you can leverage in your application.
Common useful prefabs not particularly related to a particular HoloLens feature.
Simple Tagalong billboard displaying application's frames per second.
A drop in direction indicator that stays in the users view at all times.
A quad based pointer to be used with the HeadsUpDirectionIndicator prefab to create an out of box direction indicator.
Helps the user adjust the headset so that he/she gets the full experience in demo scenarios.
When demoing an app, it is important to ensure that the user has the headset on properly. This scene shows a border at the edge of the user's field of view and instructs him/her to adjust the headset until all four edges are visible. The user (or the demonstrator) can then air-tap or say "I'm ready" to proceed to the actual experience.
This scene is designed to be the first scene the user sees, once the experience is ready to begin. Once the user is ready, it loads either the next scene in the sequence or a scene specified by the NextSceneName property of the HeadsetAdjustment script.
Creates a menu allowing you to jump to any scene in your project.
To run the SceneLauncher:
- In Unity > File Build Settings > Scenes in Build, drag in the scene files that you would like to run.
- If you would like to use all scenes in the project, search for t:Scene in the Project tab, select all, and drag all scenes into Scenes in Build.
- After adding scenes to the build, you can use the Scene Mapping setting in the SceneLauncher prefab to control which scenes are included or not included in the SceneLauncher menu.
- Build and run your project. (Or open the SceneLauncher scene and hit Play in the Unity editor.) A grid will be created with a button for each of your scenes.
- Air tap a scene to load it.
- When finished with a scene, say "Scene Launcher" or press the Backspace key to return the the scene list.
Utilitiy Scripts.
Editor Specific Scripts.
Configuration options derived from Microsoft Documentation Configuring a Unity Project for HoloLens.
Base class for auto configuration build windows.
Renders the UI and handles update logic for HoloToolkit/Configure/Apply HoloLens Capability Settings.
Extensions for the UnityEnditor.EditorGUI class.
Extensions for the UnityEditor.EditorGUILayout class.
Sets Force Text Serialization and visible meta files in all projects that use the HoloToolkit.
Helper class for launching external processes inside of the unity editor.
Extensions for the UnityEngine.LayerMask class.
Renders the UI and handles update logic for HoloToolkit/Configure/Apply HoloLens Project Settings.
Renders the UI and handles update logic for HoloToolkit/Configure/Apply HoloLens Scene Settings.
Extensions for the action class. These methods encapsulate the null check before raising an event for an Action.
Extensions methods for the Unity Component class. This also includes some component-related extensions for the GameObjet class.
A class with general purpose extensions methods.
An extension method that will get you the full path to an object.
A collection of useful extension methods for Unity's Vector structs.
Interpolated Value Scripts.
Provides interpolation over Color.
Provides interpolation over float.
Provides interpolation over Quaternion.
Base class that provides the common logic for interpolating between values. This class does not inherit from MonoBehaviour in order to enable various scenarios under which it used. To perform the interpolation step, call FrameUpdate.
Provides interpolation over Vector2.
Provides interpolation over Vector3.
Class to encapsulate an interpolating Quaternion property. TODO: Remove if redundant to InterpolatedQuaternion.cs
Class to encapsulate an interpolating Vector3 property. TODO: Remove if reduncatnt to InterpolatedVector3.cs
Switchs app to a XAML page vaiew, and waits for a return value from it.
Rotates a hologram so it is always facing towards the camera.
Helper class for bit manipulation.
Helper class for transmitting data over network.
Show a GameObject around the cursor that points in the direction of the GameObject which this script is attached to.
You must provide GameObjects for the Cursor and DirectionIndicatorObject public fields.
Cursor The object in your scene that is being used as the cursor. The direction indicator will be rendered around this cursor.
DirectionIndicatorObject The object that will point in the direction toward the object which this script is attached to. This object can be a 2D or 3D object.
DirectionIndicatorColor The color you want the DirectionIndicatorObject to be. The material on the DirectionIndicatorObject will need to support the color or TintColor property for this field to work. Otherwise the DirectionIndicatorObject will continue to render as its exported color.
TitleSafeFactor The percentage the GameObject can be within the view frustum for the DirectionIndicatorObject to start appearing. A value of 0 will display the DirectionIndicatorObject when the GameObject leaves the view. 0.1 will display when the GameObject is 10% away from the edge of the view. -0.1 will display when the GameObject is 10% out of view.
Causes a hologram to maintain a fixed angular size, which is to say it occupies the same pixels in the view regardless of its distance from the camera.
Simple Behaviour which calculates the average frames per second over a number of frames and shows the FPS in a referenced Text control.
Spawns a user specified "pointer" object and startup and alligns it to aim at a target object which keeping the pointer in view at all times.
Static class containing interpolation-related utility functions.
A MonoBehaviour that interpolates a transform's position, rotation or scale.
Math Utilities class.
Updates the shader parameters for use in near plane fading.
Min-heap priority queue. In other words, lower priorities will be removed from the queue first. See Binary Heap for more info.
Extensions methods for the Session class.
A Tagalong that stays at a fixed distance from the camera and always seeks to have a part of itself in the view frustum of the camera.
A base class to make a MonoBehaviour follow the singleton design pattern.
A simple Tagalong that stays inside a sphere at a fixed distance from the camera. Very cheap implementation with smoothing capability.
StabilizationPlaneModifier handles the setting of the stabilization plane in several ways.
A Tagalong that extends SimpleTagalong that allows for specifying the minimum and target percentage of the object to keep in the view frustum of the camera and that keeps the Tagalong object in front of other holograms including the Spatial Mapping Mesh.
Provides dynamic Text to Speech. Speech is generated using the UWP SpeechSynthesizer and then played through a Unity AudioSource. Both plain text and SSML are supported.
Structure that defines a timer. A timer can be scheduled through the TimerScheduler.
A scheduler that manages various timers.
Miscellaneous utility methods.
Vector Statistics used in gaze stabilization.
Wrapper around world anchor store to streamline some of the persistence api busy work.
Preprocessor macros to support shaders
Common shader functionality
Very fast shader that uses the Unity light system. Compiles down to only performing the operations you're actually using. Uses material property drawers rather than a custom editor for ease of maintenance.
Similar attributes for FastConfigurable with the benefit of 2 sides!
A simple occlusion shader that can be used to hide other objects. This prevents other objects from being rendered by drawing invisible 'opaque' pixels to the depth buffer. This shader differs from Occlusion.shader in that it doesn't have any depth offset, so it should sort as expected with other objects adjacent to the window.
Tests related to the utilities features. To use the scene:
- Navigate to the Tests folder.
- Double click on the test scene you wish to explore.
- Either click "Play" in the unity editor or File -> Build Settings.
- Add Open Scenes, Platform -> Windows Store, SDK -> Universal 10, Build Type -> D3D, Check 'Unity C# Projects'.
- Click 'Build' and create an App folder. When compile is done, open the solution and deploy to device.
This scene shows 7 marker objects with 7 HeadsUpDirectionIndicators pointing to each. Each indicator has a label that matches its corresponding marker. 6 of the marker/indicator pairs are used to test the edge cases of axis aligned markers. The 7th is an arbitrary point off of the cartesean axes. From the starting position, the user should be able to follow the direction of each indicator and arrive at the marker with the corresponding axis label. At the start, the labels should be in the following screen locations.
- -X at the left
- +X at the right
- -Y at the bottom
- +Y at the top
- -Z also at the bottom
- +Z in front
This scene demonstrates how to use TextToSpeechManager.cs. The script is placed on 3 cubes in the scene. Whenever a cube is activated with an air tap, a text to speech voice will emanate from the cube. The user can also ask "What time is it?" to hear the current time from a voice that stays with the user as they move.
This scene demonstrates how to use WindowOcclusion.shader. It positions a virtual 'window' directly in front of you when the scene starts. A cube in the back is only visible when viewed through the window because quads around the window use the WindowOcclusion shader.