├── .gitattributes ├── .gitignore ├── LICENSE ├── Packages └── ConnectorPackage.unitypackage ├── README.md ├── SimpleUwpTwoWayComms ├── SimpleUwpTwoWayComms.sln └── SimpleUwpTwoWayComms │ ├── AutoConnectMessagePipe.cs │ ├── BluetoothLEStreamSocketAdvertisement.cs │ ├── BluetoothLEStreamSocketAdvertiser.cs │ ├── BluetoothLEStreamSocketDiscoveredEventArgs.cs │ ├── BluetoothLEStreamSocketWatcher.cs │ ├── IPAddressExtensions.cs │ ├── Properties │ ├── AssemblyInfo.cs │ └── SimpleUwpTwoWayComms.rd.xml │ ├── SimpleUwpTwoWayComms.csproj │ └── project.json ├── UnityHoloLensTestApp └── HoloLensTestApp │ ├── .gitignore │ ├── Assets │ ├── HoloToolkit │ │ ├── Build │ │ │ ├── Editor │ │ │ │ ├── BuildDeployPortal.cs │ │ │ │ ├── BuildDeployPrefs.cs │ │ │ │ ├── BuildDeployTools.cs │ │ │ │ ├── BuildDeployWindow.cs │ │ │ │ ├── BuildSLNUtilities.cs │ │ │ │ ├── HoloToolkitCommands.cs │ │ │ │ └── XdeGuestLocator.cs │ │ │ └── README.md │ │ ├── CrossPlatform │ │ │ ├── README.md │ │ │ └── Scripts │ │ │ │ ├── MetroHandleRef.cs │ │ │ │ ├── Reflection │ │ │ │ ├── ReflectionExtensions.cs │ │ │ │ └── TypeUtils.cs │ │ │ │ └── SystemException.cs │ │ ├── Input │ │ │ ├── Animations │ │ │ │ └── Cursor │ │ │ │ │ ├── CursorIdleAnim.anim │ │ │ │ │ ├── CursorIdleRingAnim.anim │ │ │ │ │ ├── CursorSimple.controller │ │ │ │ │ └── CursorWaitingAnim.anim │ │ │ ├── Materials │ │ │ │ ├── CursorMaterial.mat │ │ │ │ ├── hand_down.mat │ │ │ │ ├── hand_up.mat │ │ │ │ └── ring_shadow.mat │ │ │ ├── Models │ │ │ │ └── Cursor │ │ │ │ │ ├── Cursor.fbx │ │ │ │ │ ├── cursor_hand_ready.fbm │ │ │ │ │ ├── hand_down.png │ │ │ │ │ └── hand_up.png │ │ │ │ │ ├── cursor_hand_ready.fbx │ │ │ │ │ ├── cursor_ready.fbm │ │ │ │ │ └── ring_shadow.png │ │ │ │ │ └── cursor_ready.fbx │ │ │ ├── Plugins │ │ │ │ └── WSA │ │ │ │ │ └── ARM │ │ │ │ │ └── MicStreamSelector.dll │ │ │ ├── Prefabs │ │ │ │ ├── Cursor │ │ │ │ │ ├── BasicCursor.prefab │ │ │ │ │ ├── Cursor.prefab │ │ │ │ │ ├── CursorWithFeedback.prefab │ │ │ │ │ ├── DefaultCursor.prefab │ │ │ │ │ └── HandDetectedFeedback.prefab │ │ │ │ ├── HoloLensCamera.prefab │ │ │ │ └── InputManager.prefab │ │ │ ├── README.md │ │ │ ├── Scripts │ │ │ │ ├── Cursor │ │ │ │ │ ├── AnimatedCursor.cs │ │ │ │ │ ├── Cursor.cs │ │ │ │ │ ├── CursorModifier.cs │ │ │ │ │ ├── ICursor.cs │ │ │ │ │ ├── ICursorModifier.cs │ │ │ │ │ ├── MeshCursor.cs │ │ │ │ │ ├── ObjectCursor.cs │ │ │ │ │ └── SpriteCursor.cs │ │ │ │ ├── GameControllerManipulator.cs │ │ │ │ ├── Gaze │ │ │ │ │ ├── BaseRayStabilizer.cs │ │ │ │ │ ├── GazeManager.cs │ │ │ │ │ └── GazeStabilizer.cs │ │ │ │ ├── HandGuidance.cs │ │ │ │ ├── InputEvents │ │ │ │ │ ├── BaseInputEventData.cs │ │ │ │ │ ├── HoldEventData.cs │ │ │ │ │ ├── IFocusable.cs │ │ │ │ │ ├── IHoldHandler.cs │ │ │ │ │ ├── IInputClickHandler.cs │ │ │ │ │ ├── IInputHandler.cs │ │ │ │ │ ├── IManipulationHandler.cs │ │ │ │ │ ├── INavigationHandler.cs │ │ │ │ │ ├── ISourceStateHandler.cs │ │ │ │ │ ├── ISpeechHandler.cs │ │ │ │ │ ├── InputEventData.cs │ │ │ │ │ ├── ManipulationEventData.cs │ │ │ │ │ ├── NavigationEventData.cs │ │ │ │ │ ├── SourceStateEventData.cs │ │ │ │ │ └── SpeechKeywordRecognizedEventData.cs │ │ │ │ ├── InputManager.cs │ │ │ │ ├── InputSources │ │ │ │ │ ├── BaseInputSource.cs │ │ │ │ │ ├── EditorHandsInput.cs │ │ │ │ │ ├── GesturesInput.cs │ │ │ │ │ ├── IInputSource.cs │ │ │ │ │ ├── InputSourceEventArgs.cs │ │ │ │ │ ├── RawInteractionSourcesInput.cs │ │ │ │ │ └── SpeechKeywordRecognizedEventArgs.cs │ │ │ │ ├── Interactions │ │ │ │ │ └── HandDraggable.cs │ │ │ │ ├── KeyboardManager.cs │ │ │ │ ├── Microphone │ │ │ │ │ └── MicStream.cs │ │ │ │ ├── SetGlobalListener.cs │ │ │ │ ├── UI │ │ │ │ │ └── TriggerButton.cs │ │ │ │ ├── Utilities │ │ │ │ │ ├── AxisController.cs │ │ │ │ │ ├── ButtonController.cs │ │ │ │ │ ├── ManualGazeControl.cs │ │ │ │ │ └── ManualHandControl.cs │ │ │ │ └── Voice │ │ │ │ │ ├── Editor │ │ │ │ │ ├── KeywordAndKeyCodeDrawer.cs │ │ │ │ │ └── SpeechInputSourceEditor.cs │ │ │ │ │ ├── KeywordManager.cs │ │ │ │ │ └── SpeechInputSource.cs │ │ │ ├── Shaders │ │ │ │ ├── Cursor.shader │ │ │ │ ├── CursorShader.shader │ │ │ │ ├── EditorHands.shader │ │ │ │ └── SpecularHighlight.shader │ │ │ └── Tests │ │ │ │ ├── AnimationControllers │ │ │ │ ├── button_test_ac.controller │ │ │ │ └── popup_test_ac.controller │ │ │ │ ├── Animations │ │ │ │ ├── button_test_dehydrate_idle_anim.anim │ │ │ │ ├── button_test_dehydration_anim.anim │ │ │ │ ├── button_test_deselected_anim.anim │ │ │ │ ├── button_test_hover_anim.anim │ │ │ │ ├── button_test_hydration_anim.anim │ │ │ │ ├── button_test_idle_anim.anim │ │ │ │ ├── button_test_selected_anim.anim │ │ │ │ ├── button_test_selected_idle_anim.anim │ │ │ │ ├── button_test_stayfocused_anim.anim │ │ │ │ ├── popup_dehydrate_anim.anim │ │ │ │ ├── popup_dehydrate_idle_anim.anim │ │ │ │ ├── popup_hydrate_anim.anim │ │ │ │ └── popup_idle_anim.anim │ │ │ │ ├── Materials │ │ │ │ ├── HoloToolkit_Focusable.mat │ │ │ │ ├── MovableObjects.mat │ │ │ │ ├── TestDiffuse.mat │ │ │ │ ├── TestDiffuse_Popup.mat │ │ │ │ └── button_test_mat.mat │ │ │ │ ├── Meshes │ │ │ │ └── button_test_msh.fbx │ │ │ │ ├── Prefabs │ │ │ │ ├── FocusedObjectCube.prefab │ │ │ │ ├── FocusedObjectKeywordManager.prefab │ │ │ │ ├── FocusedObjectSphere.prefab │ │ │ │ ├── SelectedObjectCube.prefab │ │ │ │ ├── SelectedObjectKeywordManager.prefab │ │ │ │ ├── SelectedObjectSphere.prefab │ │ │ │ ├── TextPanel.prefab │ │ │ │ ├── button_test_pfb.prefab │ │ │ │ └── inputburst_ps.prefab │ │ │ │ ├── Scenes │ │ │ │ ├── BasicCursor.unity │ │ │ │ ├── Cursor.unity │ │ │ │ ├── CursorWithFeedback.unity │ │ │ │ ├── FocusedObjectKeywords.unity │ │ │ │ ├── GazeEvents.unity │ │ │ │ ├── InputManagerTest.unity │ │ │ │ ├── InputTapTest.unity │ │ │ │ ├── KeywordManager.unity │ │ │ │ ├── ManualCameraControl.unity │ │ │ │ ├── MicrophoneStream.unity │ │ │ │ ├── SelectedObjectKeywords.unity │ │ │ │ └── SpeechInputSource.unity │ │ │ │ ├── Scripts │ │ │ │ ├── ButtonObjectScaler.cs │ │ │ │ ├── ButtonTimedWaiter.cs │ │ │ │ ├── DehydrationDeactivation.cs │ │ │ │ ├── DisplayKeywords.cs │ │ │ │ ├── DisplaySpeechKeywords.cs │ │ │ │ ├── FocusedObjectColorChanger.cs │ │ │ │ ├── FocusedObjectMessageSender.cs │ │ │ │ ├── GazeResponder.cs │ │ │ │ ├── InputHandleCallbackFX.cs │ │ │ │ ├── InputTest.cs │ │ │ │ ├── MicStreamDemo.cs │ │ │ │ ├── OnFocusEvent.cs │ │ │ │ ├── PopupMenu.cs │ │ │ │ ├── ScaleObjectMessageReceiver.cs │ │ │ │ ├── SelectedObjectMessageReceiver.cs │ │ │ │ ├── SelectedObjectMessageSender.cs │ │ │ │ ├── SimpleGridGenerator.cs │ │ │ │ ├── SphereGlobalKeywords.cs │ │ │ │ ├── SphereKeywords.cs │ │ │ │ ├── TapResponder.cs │ │ │ │ ├── TestButton.cs │ │ │ │ └── TogglePopupMenu.cs │ │ │ │ ├── Shaders │ │ │ │ ├── SkyboxProbe-0.exr │ │ │ │ └── button_unlit_shader.shader │ │ │ │ └── Textures │ │ │ │ └── button_test_cubemap.tga │ │ ├── UI │ │ │ ├── Materials │ │ │ │ └── 3DTextSegoeUI.mat │ │ │ ├── Prefabs │ │ │ │ ├── 3DTextPrefab.prefab │ │ │ │ └── UITextPrefab.prefab │ │ │ ├── README.md │ │ │ └── Shaders │ │ │ │ └── 3DTextShader.shader │ │ └── Utilities │ │ │ ├── Editor │ │ │ ├── AutoConfigureMenu.cs │ │ │ ├── AutoConfigureWindow.cs │ │ │ ├── CapabilitySettingsWindow.cs │ │ │ ├── EditorGUIExtensions.cs │ │ │ ├── EditorGUILayoutExtensions.cs │ │ │ ├── EnforceEditorSettings.cs │ │ │ ├── LayerMaskExtensions.cs │ │ │ ├── ProjectSettingsWindow.cs │ │ │ └── SceneSettingsWindow.cs │ │ │ ├── Materials │ │ │ ├── ArrowOnTop.mat │ │ │ └── HoloToolkit_Default.mat │ │ │ ├── Prefabs │ │ │ ├── FPSDisplay.prefab │ │ │ ├── HeadsUpDirectionIndicator.prefab │ │ │ └── HeadsUpDirectionIndicatorPointer.prefab │ │ │ ├── README.md │ │ │ ├── Scripts │ │ │ ├── Billboard.cs │ │ │ ├── DirectionIndicator.cs │ │ │ ├── Extensions │ │ │ │ ├── ActionExtensions.cs │ │ │ │ ├── ComponentExtensions.cs │ │ │ │ ├── Extensions.cs │ │ │ │ ├── TransformExtensions.cs │ │ │ │ └── VectorExtensions.cs │ │ │ ├── FixedAngularSize.cs │ │ │ ├── FpsDisplay.cs │ │ │ ├── HeadsUpDirectionIndicator.cs │ │ │ ├── InterpolationUtilities.cs │ │ │ ├── Interpolator.cs │ │ │ ├── NearPlaneFade.cs │ │ │ ├── PriorityQueue.cs │ │ │ ├── RollingStatistics.cs │ │ │ ├── SimpleTagalong.cs │ │ │ ├── Singleton.cs │ │ │ ├── SphereBasedTagalong.cs │ │ │ ├── StabilizationPlaneModifier.cs │ │ │ ├── Tagalong.cs │ │ │ ├── TextToSpeechManager.cs │ │ │ ├── Timer.cs │ │ │ ├── TimerScheduler.cs │ │ │ └── WorldAnchorManager.cs │ │ │ ├── Shaders │ │ │ ├── BlinnPhongConfigurable.cginc │ │ │ ├── BlinnPhongConfigurable.shader │ │ │ ├── BlinnPhongConfigurableTransparent.shader │ │ │ ├── HoloToolkitCommon.cginc │ │ │ ├── LambertianConfigurable.cginc │ │ │ ├── LambertianConfigurable.shader │ │ │ ├── LambertianConfigurableTransparent.shader │ │ │ ├── StandardFast.shader │ │ │ ├── UnlitConfigurable.cginc │ │ │ ├── UnlitConfigurable.shader │ │ │ ├── UnlitConfigurableTransparent.shader │ │ │ ├── UnlitNoDepthTest.shader │ │ │ ├── VertexLitConfigurable.cginc │ │ │ ├── VertexLitConfigurable.shader │ │ │ ├── VertexLitConfigurableTransparent.shader │ │ │ └── WindowOcclusion.shader │ │ │ ├── Tests │ │ │ ├── Animations │ │ │ │ ├── PopupText.controller │ │ │ │ ├── horizontal.anim │ │ │ │ ├── horizontal.controller │ │ │ │ ├── spiral.anim │ │ │ │ ├── spiral.controller │ │ │ │ ├── textfade.anim │ │ │ │ └── vertical.anim │ │ │ ├── Materials │ │ │ │ ├── DrawOverNegativeX.mat │ │ │ │ ├── DrawOverNegativeY.mat │ │ │ │ ├── DrawOverNegativeZ.mat │ │ │ │ ├── DrawOverPositiveX.mat │ │ │ │ ├── DrawOverPositiveY.mat │ │ │ │ ├── DrawOverPositiveZ.mat │ │ │ │ ├── MarkerNegativeX.mat │ │ │ │ ├── MarkerNegativeY.mat │ │ │ │ ├── MarkerNegativeZ.mat │ │ │ │ ├── MarkerPositiveX.mat │ │ │ │ ├── MarkerPositiveY.mat │ │ │ │ ├── MarkerPositiveZ.mat │ │ │ │ ├── WindowContents.mat │ │ │ │ └── WindowOcclusion.mat │ │ │ ├── Prefabs │ │ │ │ ├── HeadsUpDirectionIndicatorPointerNegativeX.prefab │ │ │ │ ├── HeadsUpDirectionIndicatorPointerNegativeY.prefab │ │ │ │ ├── HeadsUpDirectionIndicatorPointerNegativeZ.prefab │ │ │ │ ├── HeadsUpDirectionIndicatorPointerPositiveX.prefab │ │ │ │ ├── HeadsUpDirectionIndicatorPointerPositiveY.prefab │ │ │ │ ├── HeadsUpDirectionIndicatorPointerPositiveZ.prefab │ │ │ │ └── dot.prefab │ │ │ ├── Scenes │ │ │ │ ├── FixedAngularSize.unity │ │ │ │ ├── HeadsUpDirectionIndicator.unity │ │ │ │ ├── SphereBasedTagalong.unity │ │ │ │ ├── StabilizationPlaneSetting.unity │ │ │ │ ├── TextToSpeechManager.unity │ │ │ │ └── WindowOcclusion.unity │ │ │ ├── Scripts │ │ │ │ ├── GestureResponder.cs │ │ │ │ ├── PlaneTargetGroup.cs │ │ │ │ ├── PlaneTargetGroupPicker.cs │ │ │ │ ├── TextToSpeechManagerTest.cs │ │ │ │ └── TextToSpeechOnTap.cs │ │ │ └── Textures │ │ │ │ ├── ArrowNegativeX.png │ │ │ │ ├── ArrowNegativeY.png │ │ │ │ ├── ArrowNegativeZ.png │ │ │ │ ├── ArrowPositiveX.png │ │ │ │ ├── ArrowPositiveY.png │ │ │ │ ├── ArrowPositiveZ.png │ │ │ │ ├── NegativeX.png │ │ │ │ ├── NegativeY.png │ │ │ │ ├── NegativeZ.png │ │ │ │ ├── PositiveX.png │ │ │ │ ├── PositiveY.png │ │ │ │ └── PositiveZ.png │ │ │ └── Textures │ │ │ └── Arrow.png │ ├── MainScene.unity │ ├── Newtonsoft.Json.dll │ ├── Placeholder.cs │ └── SimpleUwpTwoWayComms.dll │ └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ └── UnityConnectSettings.asset └── XamlTestApp ├── App.xaml ├── App.xaml.cs ├── Assets ├── LockScreenLogo.scale-200.png ├── SplashScreen.scale-200.png ├── Square150x150Logo.scale-200.png ├── Square44x44Logo.scale-200.png ├── Square44x44Logo.targetsize-24_altform-unplated.png ├── StoreLogo.png └── Wide310x150Logo.scale-200.png ├── MainControl.xaml ├── MainControl.xaml.cs ├── NotConverter.cs ├── Package.appxmanifest ├── Properties ├── AssemblyInfo.cs └── Default.rd.xml ├── XamlTestApp.csproj └── project.json /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Mike Taulty 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/ConnectorPackage.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/Packages/ConnectorPackage.unitypackage -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SimpleUwpTwoWayComms 2 | Simple two-way TCP socket based library for UWP comms between 2 devices 3 | -------------------------------------------------------------------------------- /SimpleUwpTwoWayComms/SimpleUwpTwoWayComms/BluetoothLEStreamSocketAdvertisement.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleUwpTwoWayComms 2 | { 3 | using System; 4 | using System.Net; 5 | using System.Runtime.InteropServices; 6 | using Windows.Storage.Streams; 7 | 8 | public class BluetoothLEStreamSocketAdvertisement 9 | { 10 | private BluetoothLEStreamSocketAdvertisement() 11 | { 12 | 13 | } 14 | public BluetoothLEStreamSocketAdvertisement(IPAddress address, ushort port) 15 | { 16 | this.Address = address; 17 | this.Port = port; 18 | } 19 | public IBuffer WriteToBuffer() 20 | { 21 | DataWriter writer = new DataWriter(); 22 | writer.WriteUInt32(MAGIC_HEADER); 23 | 24 | var bits = this.Address.GetAddressBytes(); 25 | writer.WriteUInt16((ushort)bits.Length); 26 | writer.WriteBytes(bits); 27 | writer.WriteUInt16(this.Port); 28 | return (writer.DetachBuffer()); 29 | } 30 | public static BluetoothLEStreamSocketAdvertisement ReadFromBuffer(IBuffer buffer) 31 | { 32 | BluetoothLEStreamSocketAdvertisement returnValue = null; 33 | 34 | var dataReader = DataReader.FromBuffer(buffer); 35 | 36 | if (dataReader.UnconsumedBufferLength >= Marshal.SizeOf()) 37 | { 38 | var magicHeader = dataReader.ReadUInt32(); 39 | 40 | if (magicHeader == MAGIC_HEADER) 41 | { 42 | returnValue = new BluetoothLEStreamSocketAdvertisement(); 43 | 44 | var bitLength = dataReader.ReadUInt16(); 45 | var bits = new byte[bitLength]; 46 | dataReader.ReadBytes(bits); 47 | returnValue.Address = new IPAddress(bits); 48 | returnValue.Port = dataReader.ReadUInt16(); 49 | } 50 | } 51 | return (returnValue); 52 | } 53 | public IPAddress Address { get; private set; } 54 | public ushort Port { get; private set; } 55 | 56 | static readonly UInt32 MAGIC_HEADER = 0xFEEDF00D; 57 | 58 | // Note: this may not be the best idea in terms of using the Microsoft bluetooth 59 | // id here, I just picked one. 60 | internal static readonly ushort MS_BLUETOOTH_LE_ID = 6; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /SimpleUwpTwoWayComms/SimpleUwpTwoWayComms/BluetoothLEStreamSocketDiscoveredEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleUwpTwoWayComms 2 | { 3 | using System; 4 | 5 | public class BluetoothLEStreamSocketDiscoveredEventArgs : EventArgs 6 | { 7 | public BluetoothLEStreamSocketAdvertisement Advertisement { get; internal set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SimpleUwpTwoWayComms/SimpleUwpTwoWayComms/BluetoothLEStreamSocketWatcher.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleUwpTwoWayComms 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Net; 6 | using Windows.Devices.Bluetooth.Advertisement; 7 | 8 | class BluetoothLEStreamSocketWatcher 9 | { 10 | public event EventHandler StreamSocketDiscovered; 11 | 12 | public BluetoothLEStreamSocketWatcher(IPAddress localAddress) 13 | { 14 | this.localAddress = localAddress; 15 | this.uniqueAdvertisements = new List(); 16 | } 17 | public void Start() 18 | { 19 | if (this.bluetoothWatcher != null) 20 | { 21 | throw new InvalidOperationException("Already started"); 22 | } 23 | // Listen for remote advertisements. 24 | this.bluetoothWatcher = new BluetoothLEAdvertisementWatcher(); 25 | this.bluetoothWatcher.AdvertisementFilter.Advertisement.ManufacturerData.Add( 26 | new BluetoothLEManufacturerData() 27 | { 28 | CompanyId = BluetoothLEStreamSocketAdvertisement.MS_BLUETOOTH_LE_ID 29 | } 30 | ); 31 | this.bluetoothWatcher.Received += OnBluetoothAdvertisementSpotted; 32 | this.bluetoothWatcher.Start(); 33 | } 34 | public void Stop() 35 | { 36 | if (this.bluetoothWatcher != null) 37 | { 38 | this.bluetoothWatcher.Received -= this.OnBluetoothAdvertisementSpotted; 39 | this.bluetoothWatcher.Stop(); 40 | this.bluetoothWatcher = null; 41 | } 42 | else 43 | { 44 | throw new InvalidOperationException("Not watching"); 45 | } 46 | this.uniqueAdvertisements.Clear(); 47 | } 48 | void OnBluetoothAdvertisementSpotted( 49 | BluetoothLEAdvertisementWatcher sender, 50 | BluetoothLEAdvertisementReceivedEventArgs args) 51 | { 52 | foreach (var item in args.Advertisement.GetManufacturerDataByCompanyId( 53 | BluetoothLEStreamSocketAdvertisement.MS_BLUETOOTH_LE_ID)) 54 | { 55 | var advertisement = BluetoothLEStreamSocketAdvertisement.ReadFromBuffer(item.Data); 56 | 57 | if (advertisement != null) 58 | { 59 | if ((advertisement.Address.ToString() != this.localAddress.ToString()) && 60 | !IsRepeatAdvertisement(advertisement)) 61 | { 62 | this.StreamSocketDiscovered?.Invoke(this, 63 | new BluetoothLEStreamSocketDiscoveredEventArgs() 64 | { 65 | Advertisement = advertisement 66 | }); 67 | 68 | this.uniqueAdvertisements.Add(advertisement); 69 | } 70 | } 71 | } 72 | } 73 | bool IsRepeatAdvertisement(BluetoothLEStreamSocketAdvertisement advertisement) 74 | { 75 | return ( 76 | this.uniqueAdvertisements.Exists( 77 | e => ((e.Port == advertisement.Port) && 78 | (e.Address.ToString() == advertisement.Address.ToString())))); 79 | } 80 | BluetoothLEAdvertisementWatcher bluetoothWatcher; 81 | List uniqueAdvertisements; 82 | IPAddress localAddress; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /SimpleUwpTwoWayComms/SimpleUwpTwoWayComms/IPAddressExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleUwpTwoWayComms 2 | { 3 | using System.Linq; 4 | using System.Net; 5 | using Windows.Networking.Connectivity; 6 | 7 | internal static class IPAddressExtensions 8 | { 9 | public static IPAddress GetForLocalInternetProfile() 10 | { 11 | // TODO: Find a better way of doing everything in this function :-) 12 | var internetProfile = NetworkInformation.GetInternetConnectionProfile(); 13 | 14 | var hostName = 15 | NetworkInformation.GetHostNames().SingleOrDefault( 16 | name => 17 | name.IPInformation?.NetworkAdapter?.NetworkAdapterId == 18 | internetProfile.NetworkAdapter.NetworkAdapterId); 19 | 20 | return (IPAddress.Parse(hostName.ToString())); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SimpleUwpTwoWayComms/SimpleUwpTwoWayComms/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SimpleUwpTwoWayComms")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SimpleUwpTwoWayComms")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /SimpleUwpTwoWayComms/SimpleUwpTwoWayComms/Properties/SimpleUwpTwoWayComms.rd.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /SimpleUwpTwoWayComms/SimpleUwpTwoWayComms/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0", 4 | "Newtonsoft.Json": "9.0.1" 5 | }, 6 | "frameworks": { 7 | "uap10.0": {} 8 | }, 9 | "runtimes": { 10 | "win10-arm": {}, 11 | "win10-arm-aot": {}, 12 | "win10-x86": {}, 13 | "win10-x86-aot": {}, 14 | "win10-x64": {}, 15 | "win10-x64-aot": {} 16 | } 17 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/.gitignore: -------------------------------------------------------------------------------- 1 | # Unity bits 2 | /[Ll]ibrary/ 3 | /[Tt]emp/ 4 | /[Oo]bj/ 5 | /[Bb]uild/ 6 | /[Bb]uilds/ 7 | /[Ww]indowsStoreApp/ 8 | /[Uu]WP/ 9 | /Assets/AssetStoreTools* 10 | 11 | # Visual Studio 2015 cache directory 12 | /.vs/ 13 | 14 | # Autogenerated VS/MD/Consulo solution and project files 15 | ExportedObj/ 16 | .consulo/ 17 | *.csproj 18 | *.unityproj 19 | *.sln 20 | *.suo 21 | *.tmp 22 | *.user 23 | *.userprefs 24 | *.pidb 25 | *.booproj 26 | *.svd 27 | *.pdb 28 | 29 | 30 | # Unity3D generated meta files 31 | *.pidb.meta 32 | 33 | # Unity3D Generated File On Crash Reports 34 | sysinfo.txt 35 | 36 | # Builds 37 | *.apk 38 | *.unitypackage -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Build/Editor/HoloToolkitCommands.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License. See LICENSE in the project root for license information. 4 | // 5 | 6 | using HoloToolkit.Unity; 7 | 8 | /// 9 | /// Implements functionality for building HoloLens applications 10 | /// 11 | public static class HoloToolkitCommands 12 | { 13 | /// 14 | /// Do a build configured for the HoloLens, returns the error from BuildPipeline.BuildPlayer 15 | /// 16 | public static bool BuildSLN() 17 | { 18 | return BuildDeployTools.BuildSLN(BuildDeployPrefs.BuildDirectory, false); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Build/README.md: -------------------------------------------------------------------------------- 1 | ## [Build]() 2 | Build and deploy automation window for building your VS solution, APPX, installing, launching, and getting the log file (and other related functionality). Requires that the device has been paired with the Editor PC & that the device is connected locally and/or the HTTPS requirement has been disabled in the device portal's security tab. 3 | 4 | ### [Editor](Editor) 5 | 6 | #### BuildDeployPortal.cs 7 | Interface function with the device (REST API utility functions) 8 | 9 | #### BuildDeployTools.cs 10 | Supports building the APPX from the SLN 11 | 12 | #### BuildSLNUtilities.cs 13 | Supports building the project SLN 14 | 15 | #### BuildDeployWindow.cs 16 | Editor UI for the window and event functions 17 | 18 | --- 19 | ##### [Go back up to the table of contents.](../../../README.md) 20 | --- 21 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/CrossPlatform/README.md: -------------------------------------------------------------------------------- 1 | ## [CrossPlatform]() 2 | Wrapper scripts for Win32 and WinRT APIs in a single API call that works in the Unity editor and in a UWP application. 3 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/CrossPlatform/Scripts/MetroHandleRef.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | #if UNITY_METRO && !UNITY_EDITOR 5 | 6 | using System; 7 | 8 | namespace System.Runtime.InteropServices 9 | { 10 | [ComVisible (true)] 11 | public struct HandleRef 12 | { 13 | object wrapper; 14 | IntPtr handle; 15 | 16 | public HandleRef (object wrapper, IntPtr handle) 17 | { 18 | this.wrapper = wrapper; 19 | this.handle = handle; 20 | } 21 | 22 | public IntPtr Handle 23 | { 24 | get { return handle; } 25 | } 26 | 27 | public object Wrapper 28 | { 29 | get { return wrapper; } 30 | } 31 | 32 | public static explicit operator IntPtr (HandleRef value) 33 | { 34 | return value.Handle; 35 | } 36 | 37 | public static IntPtr ToIntPtr(HandleRef value) 38 | { 39 | return value.Handle; 40 | } 41 | } 42 | } 43 | 44 | #endif -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/CrossPlatform/Scripts/Reflection/TypeUtils.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Text; 9 | 10 | public static class TypeUtils 11 | { 12 | public static Type GetBaseType(this Type type) 13 | { 14 | #if UNITY_METRO && !UNITY_EDITOR 15 | return type.GetTypeInfo().BaseType; 16 | #else 17 | return type.BaseType; 18 | #endif 19 | } 20 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/CrossPlatform/Scripts/SystemException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | #if UNITY_METRO && !UNITY_EDITOR 5 | namespace System 6 | { 7 | public class SystemException : Exception 8 | { 9 | public SystemException() {} 10 | public SystemException(string message) : base(message) {} 11 | public SystemException(string message, Exception innerException) : base(message, innerException) {} 12 | } 13 | } 14 | #endif -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/Cursor.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/Cursor.fbx -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_hand_ready.fbm/hand_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_hand_ready.fbm/hand_down.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_hand_ready.fbm/hand_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_hand_ready.fbm/hand_up.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_hand_ready.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_hand_ready.fbx -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_ready.fbm/ring_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_ready.fbm/ring_shadow.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_ready.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Models/Cursor/cursor_ready.fbx -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Plugins/WSA/ARM/MicStreamSelector.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Plugins/WSA/ARM/MicStreamSelector.dll -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/Cursor/ICursor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Cursor Interface for handling input events and setting visiblity. 10 | /// 11 | public interface ICursor : IInputHandler, IInputClickHandler, ISourceStateHandler 12 | { 13 | /// 14 | /// Position of the cursor. 15 | /// 16 | Vector3 Position { get; } 17 | 18 | /// 19 | /// Rotation of the cursor. 20 | /// 21 | Quaternion Rotation { get; } 22 | 23 | /// 24 | /// Local scale of the cursor. 25 | /// 26 | Vector3 LocalScale { get; } 27 | 28 | /// 29 | /// Sets the visibility of the cursor. 30 | /// 31 | /// True if cursor should be visible, false if not. 32 | void SetVisiblity(bool visible); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/Cursor/ICursorModifier.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Cursor Modifier Interface that provides basic overrides for cursor behaviour. 10 | /// 11 | public interface ICursorModifier 12 | { 13 | /// 14 | /// Indicates whether the cursor should be visible or not. 15 | /// 16 | /// True if cursor should be visible, false if not. 17 | bool GetCursorVisibility(); 18 | 19 | /// 20 | /// Returns the cursor position after considering this modifier. 21 | /// 22 | /// Cursor that is being modified. 23 | /// New position for the cursor 24 | Vector3 GetModifiedPosition(ICursor cursor); 25 | 26 | /// 27 | /// Returns the cursor rotation after considering this modifier. 28 | /// 29 | /// Cursor that is being modified. 30 | /// New rotation for the cursor 31 | Quaternion GetModifiedRotation(ICursor cursor); 32 | 33 | /// 34 | /// Returns the cursor local scale after considering this modifier. 35 | /// 36 | /// Cursor that is being modified. 37 | /// New local scale for the cursor 38 | Vector3 GetModifiedScale(ICursor cursor); 39 | 40 | /// 41 | /// Returns the modified transform for the cursor after considering this modifier. 42 | /// 43 | /// Cursor that is being modified. 44 | /// Modified position. 45 | /// Modified rotation. 46 | /// Modified scale. 47 | void GetModifiedTransform(ICursor cursor, out Vector3 position, out Quaternion rotation, out Vector3 scale); 48 | } 49 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/Cursor/MeshCursor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using UnityEngine; 6 | 7 | namespace HoloToolkit.Unity.InputModule 8 | { 9 | /// 10 | /// Object that represents a cursor in 3D space controlled by gaze. 11 | /// 12 | public class MeshCursor : Cursor 13 | { 14 | [Serializable] 15 | public struct MeshCursorDatum 16 | { 17 | public string Name; 18 | public CursorStateEnum CursorState; 19 | public Mesh CursorMesh; 20 | public Vector3 LocalScale; 21 | public Vector3 LocalOffset; 22 | } 23 | 24 | [SerializeField] 25 | public MeshCursorDatum[] CursorStateData; 26 | 27 | /// 28 | /// Sprite renderer to change. If null find one in children 29 | /// 30 | public MeshRenderer TargetRenderer; 31 | 32 | /// 33 | /// On enable look for a sprite renderer on children 34 | /// 35 | protected override void OnEnable() 36 | { 37 | if(TargetRenderer == null) 38 | { 39 | TargetRenderer = GetComponentInChildren(); 40 | } 41 | 42 | base.OnEnable(); 43 | } 44 | 45 | /// 46 | /// Override OnCursorState change to set the correct animation 47 | /// state for the cursor 48 | /// 49 | /// 50 | public override void OnCursorStateChange(CursorStateEnum state) 51 | { 52 | base.OnCursorStateChange(state); 53 | 54 | if (state != CursorStateEnum.Contextual) 55 | { 56 | for (int i = 0; i < CursorStateData.Length; i++) 57 | { 58 | if (CursorStateData[i].CursorState == state) 59 | { 60 | SetCursorState(CursorStateData[i]); 61 | } 62 | } 63 | } 64 | } 65 | 66 | /// 67 | /// Based on the type of state info pass it through to the mesh renderer 68 | /// 69 | /// 70 | private void SetCursorState(MeshCursorDatum stateDatum) 71 | { 72 | // Return if we do not have an animator 73 | if (TargetRenderer != null) 74 | { 75 | MeshFilter mf = TargetRenderer.gameObject.GetComponent(); 76 | if(mf != null && stateDatum.CursorMesh != null) 77 | { 78 | mf.mesh = stateDatum.CursorMesh; 79 | } 80 | 81 | TargetRenderer.transform.localPosition = stateDatum.LocalOffset; 82 | TargetRenderer.transform.localScale = stateDatum.LocalScale; 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/Cursor/SpriteCursor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using UnityEngine; 6 | 7 | namespace HoloToolkit.Unity.InputModule 8 | { 9 | /// 10 | /// Object that represents a cursor comprised of sprites and colors for each state 11 | /// 12 | public class SpriteCursor : Cursor 13 | { 14 | [Serializable] 15 | public struct SpriteCursorDatum 16 | { 17 | public string Name; 18 | public CursorStateEnum CursorState; 19 | public Sprite CursorSprite; 20 | public Color CursorColor; 21 | } 22 | 23 | [SerializeField] 24 | public SpriteCursorDatum[] CursorStateData; 25 | 26 | /// 27 | /// Sprite renderer to change. If null find one in children 28 | /// 29 | public SpriteRenderer TargetRenderer; 30 | 31 | /// 32 | /// On enable look for a sprite renderer on children 33 | /// 34 | protected override void OnEnable() 35 | { 36 | if(TargetRenderer == null) 37 | { 38 | TargetRenderer = GetComponentInChildren(); 39 | } 40 | 41 | base.OnEnable(); 42 | } 43 | 44 | /// 45 | /// Override OnCursorState change to set the correct sprite 46 | /// state for the cursor 47 | /// 48 | /// 49 | public override void OnCursorStateChange(CursorStateEnum state) 50 | { 51 | base.OnCursorStateChange(state); 52 | 53 | if (state != CursorStateEnum.Contextual) 54 | { 55 | for (int i = 0; i < CursorStateData.Length; i++) 56 | { 57 | if (CursorStateData[i].CursorState == state) 58 | { 59 | SetCursorState(CursorStateData[i]); 60 | } 61 | } 62 | } 63 | } 64 | 65 | /// 66 | /// Based on the type of state info pass it through to the sprite renderer 67 | /// 68 | /// 69 | private void SetCursorState(SpriteCursorDatum stateDatum) 70 | { 71 | // Return if we do not have an animator 72 | if (TargetRenderer != null) 73 | { 74 | TargetRenderer.sprite = stateDatum.CursorSprite; 75 | TargetRenderer.color = stateDatum.CursorColor; 76 | } 77 | } 78 | 79 | } 80 | 81 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/Gaze/BaseRayStabilizer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// A base class for a stabilizer that takes an input position and orientation, and performs operations on them 10 | /// to stabilize, or smooth deltas, in the data. 11 | /// 12 | public abstract class BaseRayStabilizer : MonoBehaviour 13 | { 14 | /// 15 | /// The stabilized position. 16 | /// 17 | public abstract Vector3 StablePosition { get; } 18 | 19 | /// 20 | /// The stabilized rotation. 21 | /// 22 | public abstract Quaternion StableRotation { get; } 23 | 24 | /// 25 | /// A ray representing the stable position and orientation 26 | /// 27 | public abstract Ray StableRay { get; } 28 | 29 | /// 30 | /// Call this each frame to smooth out changes to a position and orientation. 31 | /// 32 | /// Input position to smooth. 33 | /// Input orientation to smooth. 34 | public abstract void UpdateStability(Vector3 position, Quaternion rotation); 35 | } 36 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/BaseInputEventData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Base class of all input events. 10 | /// 11 | public abstract class BaseInputEventData : BaseEventData 12 | { 13 | /// 14 | /// The source the input event originates from. 15 | /// 16 | public IInputSource InputSource { get; private set; } 17 | 18 | /// 19 | /// The id of the source the event is from, for instance the hand id. 20 | /// 21 | public uint SourceId { get; private set; } 22 | 23 | public BaseInputEventData(EventSystem eventSystem) : base(eventSystem) 24 | { 25 | } 26 | 27 | protected virtual void BaseInitialize(IInputSource inputSource, uint sourceId) 28 | { 29 | Reset(); 30 | InputSource = inputSource; 31 | SourceId = sourceId; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/HoldEventData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Event dispatched when a hold gesture is detected. 10 | /// 11 | public class HoldEventData : BaseInputEventData 12 | { 13 | public HoldEventData(EventSystem eventSystem) : base(eventSystem) 14 | { 15 | } 16 | 17 | public void Initialize(IInputSource inputSource, uint sourceId) 18 | { 19 | BaseInitialize(inputSource, sourceId); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/IFocusable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Interface to implement to react to focus enter/exit. 10 | /// 11 | public interface IFocusable : IEventSystemHandler 12 | { 13 | void OnFocusEnter(); 14 | void OnFocusExit(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/IHoldHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Interface to implement to react to hold gestures. 10 | /// 11 | public interface IHoldHandler : IEventSystemHandler 12 | { 13 | void OnHoldStarted(HoldEventData eventData); 14 | void OnHoldCompleted(HoldEventData eventData); 15 | void OnHoldCanceled(HoldEventData eventData); 16 | } 17 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/IInputClickHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Interface to implement to react to simple click input. 10 | /// 11 | public interface IInputClickHandler : IEventSystemHandler 12 | { 13 | void OnInputClicked(InputEventData eventData); 14 | } 15 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/IInputHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Interface to implement to react to simple pointer-like input. 10 | /// 11 | public interface IInputHandler : IEventSystemHandler 12 | { 13 | void OnInputUp(InputEventData eventData); 14 | void OnInputDown(InputEventData eventData); 15 | } 16 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/IManipulationHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Interface to implement to react to manipulation gestures. 10 | /// 11 | public interface IManipulationHandler : IEventSystemHandler 12 | { 13 | void OnManipulationStarted(ManipulationEventData eventData); 14 | void OnManipulationUpdated(ManipulationEventData eventData); 15 | void OnManipulationCompleted(ManipulationEventData eventData); 16 | void OnManipulationCanceled(ManipulationEventData eventData); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/INavigationHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Interface to implement to react to navigation gestures. 10 | /// 11 | public interface INavigationHandler : IEventSystemHandler 12 | { 13 | void OnNavigationStarted(NavigationEventData eventData); 14 | void OnNavigationUpdated(NavigationEventData eventData); 15 | void OnNavigationCompleted(NavigationEventData eventData); 16 | void OnNavigationCanceled(NavigationEventData eventData); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceStateHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Interface to implement to react to source state changes, such as when an input source is detected or lost. 10 | /// 11 | public interface ISourceStateHandler : IEventSystemHandler 12 | { 13 | void OnSourceDetected(SourceStateEventData eventData); 14 | void OnSourceLost(SourceStateEventData eventData); 15 | } 16 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/ISpeechHandler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Interface to implement to react to speech recognition. 10 | /// 11 | public interface ISpeechHandler : IEventSystemHandler 12 | { 13 | void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData); 14 | } 15 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/InputEventData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Describes an input event that has a source id. 10 | /// 11 | public class InputEventData : BaseInputEventData 12 | { 13 | public InputEventData(EventSystem eventSystem) : base(eventSystem) 14 | { 15 | } 16 | 17 | public void Initialize(IInputSource inputSource, uint sourceId) 18 | { 19 | BaseInitialize(inputSource, sourceId); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/ManipulationEventData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using UnityEngine.EventSystems; 6 | 7 | namespace HoloToolkit.Unity.InputModule 8 | { 9 | /// 10 | /// Describes an input event that involves content manipulation. 11 | /// 12 | public class ManipulationEventData : InputEventData 13 | { 14 | /// 15 | /// The amount of manipulation that has occurred. Usually in the form of 16 | /// delta position of a hand. 17 | /// 18 | public Vector3 CumulativeDelta { get; private set; } 19 | 20 | public ManipulationEventData(EventSystem eventSystem) : base(eventSystem) 21 | { 22 | } 23 | 24 | public void Initialize(IInputSource inputSource, uint sourceId, Vector3 cumulativeDelta) 25 | { 26 | BaseInitialize(inputSource, sourceId); 27 | CumulativeDelta = cumulativeDelta; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/NavigationEventData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using UnityEngine.EventSystems; 6 | 7 | namespace HoloToolkit.Unity.InputModule 8 | { 9 | /// 10 | /// Describes an input event that involves content navigation. 11 | /// 12 | public class NavigationEventData : InputEventData 13 | { 14 | /// 15 | /// The amount of manipulation that has occurred. Usually in the form of 16 | /// delta position of a hand. 17 | /// 18 | public Vector3 CumulativeDelta { get; private set; } 19 | 20 | public NavigationEventData(EventSystem eventSystem) : base(eventSystem) 21 | { 22 | } 23 | 24 | public void Initialize(IInputSource inputSource, uint sourceId, Vector3 cumulativeDelta) 25 | { 26 | BaseInitialize(inputSource, sourceId); 27 | CumulativeDelta = cumulativeDelta; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/SourceStateEventData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine.EventSystems; 5 | 6 | namespace HoloToolkit.Unity.InputModule 7 | { 8 | /// 9 | /// Describes an source state event that has a source id. 10 | /// 11 | public class SourceStateEventData : BaseInputEventData 12 | { 13 | public SourceStateEventData(EventSystem eventSystem) : base(eventSystem) 14 | { 15 | } 16 | 17 | public void Initialize(IInputSource inputSource, uint sourceId) 18 | { 19 | BaseInitialize(inputSource, sourceId); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputEvents/SpeechKeywordRecognizedEventData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | using UnityEngine.Windows.Speech; 8 | 9 | namespace HoloToolkit.Unity.InputModule 10 | { 11 | /// 12 | /// Describes an input event that involves keyword recognition. 13 | /// 14 | public class SpeechKeywordRecognizedEventData : InputEventData 15 | { 16 | /// 17 | /// A measure of correct recognition certainty. 18 | /// 19 | public ConfidenceLevel Confidence { get; private set; } 20 | 21 | /// 22 | /// The time it took for the phrase to be uttered. 23 | /// 24 | public TimeSpan PhraseDuration { get; private set; } 25 | 26 | /// 27 | /// The moment in time when uttering of the phrase began. 28 | /// 29 | public DateTime PhraseStartTime { get; private set; } 30 | 31 | /// 32 | /// A semantic meaning of recognized phrase. 33 | /// 34 | public SemanticMeaning[] SemanticMeanings { get; private set; } 35 | 36 | /// 37 | /// The text that was recognized. 38 | /// 39 | public string RecognizedText { get; private set; } 40 | 41 | public SpeechKeywordRecognizedEventData(EventSystem eventSystem) : base(eventSystem) 42 | { 43 | } 44 | 45 | public void Initialize(IInputSource inputSource, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText) 46 | { 47 | BaseInitialize(inputSource, sourceId); 48 | Confidence = confidence; 49 | PhraseDuration = phraseDuration; 50 | PhraseStartTime = phraseStartTime; 51 | SemanticMeanings = semanticMeanings; 52 | RecognizedText = recognizedText; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/InputSources/SpeechKeywordRecognizedEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using UnityEngine; 6 | using UnityEngine.Windows.Speech; 7 | 8 | namespace HoloToolkit.Unity.InputModule 9 | { 10 | /// 11 | /// Event args for a speech kwyword recognized event. 12 | /// 13 | public class SpeechKeywordRecognizedEventArgs : InputSourceEventArgs 14 | { 15 | /// 16 | /// A measure of correct recognition certainty. 17 | /// 18 | public ConfidenceLevel Confidence { get; private set; } 19 | 20 | /// 21 | /// The time it took for the phrase to be uttered. 22 | /// 23 | public TimeSpan PhraseDuration { get; private set; } 24 | 25 | /// 26 | /// The moment in time when uttering of the phrase began. 27 | /// 28 | public DateTime PhraseStartTime { get; private set; } 29 | 30 | /// 31 | /// A semantic meaning of recognized phrase. 32 | /// 33 | public SemanticMeaning[] SemanticMeanings { get; private set; } 34 | 35 | /// 36 | /// The text that was recognized. 37 | /// 38 | public string RecognizedText { get; private set; } 39 | 40 | public SpeechKeywordRecognizedEventArgs(IInputSource inputSource, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText) : base(inputSource, sourceId) 41 | { 42 | Confidence = confidence; 43 | PhraseDuration = phraseDuration; 44 | PhraseStartTime = phraseStartTime; 45 | SemanticMeanings = semanticMeanings; 46 | RecognizedText = recognizedText; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/SetGlobalListener.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule.Tests 7 | { 8 | /// 9 | /// Register this game object on the InputManager as a global listener. 10 | /// 11 | public class SetGlobalListener : MonoBehaviour 12 | { 13 | private void Start() 14 | { 15 | InputManager.Instance.AddGlobalListener(gameObject); 16 | } 17 | 18 | private void OnDestroy() 19 | { 20 | InputManager.Instance.RemoveGlobalListener(gameObject); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using UnityEngine; 6 | 7 | namespace HoloToolkit.Unity.InputModule 8 | { 9 | /// 10 | /// Very simple class that implements basic logic for a trigger button. 11 | /// 12 | public class TriggerButton : MonoBehaviour, IInputClickHandler 13 | { 14 | /// 15 | /// Indicates whether the button is clickable or not. 16 | /// 17 | [Tooltip("Indicates whether the button is clickable or not.")] 18 | public bool IsEnabled = true; 19 | 20 | public event Action ButtonPressed; 21 | 22 | /// 23 | /// Press the button programatically. 24 | /// 25 | public void Press() 26 | { 27 | if (IsEnabled) 28 | { 29 | ButtonPressed.RaiseEvent(); 30 | } 31 | } 32 | 33 | public void OnInputClicked(InputEventData eventData) 34 | { 35 | if (IsEnabled) 36 | { 37 | ButtonPressed.RaiseEvent(); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Scripts/Voice/Editor/KeywordAndKeyCodeDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace HoloToolkit.Unity.InputModule 5 | { 6 | [CustomPropertyDrawer(typeof(SpeechInputSource.KeywordAndKeyCode))] 7 | public class KeywordAndKeyCodeDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI(Rect rect, SerializedProperty property, GUIContent content) 10 | { 11 | EditorGUI.BeginProperty(rect, content, property); 12 | 13 | // calculate field reactangle with half of total drawer length for each 14 | float fieldWidth = rect.width * 0.5f; 15 | Rect keywordRect = new Rect(rect.x, rect.y, fieldWidth, rect.height); 16 | Rect keyCodeRect = new Rect(rect.x + fieldWidth, rect.y, fieldWidth, rect.height); 17 | 18 | // the Keyword field without label 19 | EditorGUI.PropertyField(keywordRect, property.FindPropertyRelative("Keyword"), GUIContent.none); 20 | // the KeyCode field without label 21 | EditorGUI.PropertyField(keyCodeRect, property.FindPropertyRelative("KeyCode"), GUIContent.none); 22 | 23 | EditorGUI.EndProperty(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Shaders/Cursor.shader: -------------------------------------------------------------------------------- 1 | Shader "HoloToolkit/Cursor" 2 | { 3 | Properties 4 | { 5 | _Color ("Color", Color) = (1, 1, 1, 1) 6 | } 7 | SubShader 8 | { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 100 11 | ZTest Always 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | 19 | #include "UnityCG.cginc" 20 | 21 | struct appdata 22 | { 23 | float4 vertex : POSITION; 24 | UNITY_VERTEX_INPUT_INSTANCE_ID 25 | }; 26 | 27 | struct v2f 28 | { 29 | float4 vertex : SV_POSITION; 30 | UNITY_VERTEX_OUTPUT_STEREO 31 | }; 32 | 33 | float4 _Color; 34 | 35 | v2f vert (appdata v) 36 | { 37 | UNITY_SETUP_INSTANCE_ID(v); 38 | 39 | v2f o; 40 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 41 | 42 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 43 | return o; 44 | } 45 | 46 | fixed4 frag (v2f i) : SV_Target 47 | { 48 | fixed4 col = _Color; 49 | return col; 50 | } 51 | ENDCG 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Shaders/CursorShader.shader: -------------------------------------------------------------------------------- 1 | Shader "HoloToolkit/Cursor" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | } 16 | 17 | SubShader 18 | { 19 | Tags 20 | { 21 | "Queue"="Transparent" 22 | "IgnoreProjector"="True" 23 | "RenderType"="Transparent" 24 | "PreviewType"="Plane" 25 | "CanUseSpriteAtlas"="True" 26 | } 27 | 28 | Stencil 29 | { 30 | Ref [_Stencil] 31 | Comp [_StencilComp] 32 | Pass [_StencilOp] 33 | ReadMask [_StencilReadMask] 34 | WriteMask [_StencilWriteMask] 35 | } 36 | 37 | Cull Off 38 | Lighting Off 39 | ZWrite Off 40 | ZTest [unity_GUIZTestMode] 41 | Blend SrcAlpha OneMinusSrcAlpha 42 | ColorMask [_ColorMask] 43 | 44 | Pass 45 | { 46 | CGPROGRAM 47 | #pragma vertex vert 48 | #pragma fragment frag 49 | #include "UnityCG.cginc" 50 | 51 | struct appdata_t 52 | { 53 | float4 vertex : POSITION; 54 | float4 color : COLOR; 55 | float2 texcoord : TEXCOORD0; 56 | UNITY_VERTEX_INPUT_INSTANCE_ID 57 | }; 58 | 59 | struct v2f 60 | { 61 | float4 vertex : SV_POSITION; 62 | fixed4 color : COLOR; 63 | half2 texcoord : TEXCOORD0; 64 | UNITY_VERTEX_OUTPUT_STEREO 65 | }; 66 | 67 | fixed4 _Color; 68 | 69 | v2f vert(appdata_t IN) 70 | { 71 | UNITY_SETUP_INSTANCE_ID(IN); 72 | 73 | v2f OUT; 74 | OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); 75 | OUT.texcoord = IN.texcoord; 76 | #ifdef UNITY_HALF_TEXEL_OFFSET 77 | OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1); 78 | #endif 79 | OUT.color = IN.color * _Color; 80 | 81 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 82 | return OUT; 83 | } 84 | 85 | sampler2D _MainTex; 86 | 87 | fixed4 frag(v2f IN) : SV_Target 88 | { 89 | half4 color = tex2D(_MainTex, IN.texcoord) * IN.color; 90 | clip (color.a - 0.01); 91 | return color; 92 | } 93 | ENDCG 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Shaders/EditorHands.shader: -------------------------------------------------------------------------------- 1 | Shader "HoloToolkit/EditorHands" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | } 16 | 17 | SubShader 18 | { 19 | Tags 20 | { 21 | "Queue"="Transparent" 22 | "IgnoreProjector"="True" 23 | "RenderType"="Transparent" 24 | "PreviewType"="Plane" 25 | "CanUseSpriteAtlas"="True" 26 | } 27 | 28 | Stencil 29 | { 30 | Ref [_Stencil] 31 | Comp [_StencilComp] 32 | Pass [_StencilOp] 33 | ReadMask [_StencilReadMask] 34 | WriteMask [_StencilWriteMask] 35 | } 36 | 37 | Cull Off 38 | Lighting Off 39 | ZWrite Off 40 | ZTest [unity_GUIZTestMode] 41 | Blend SrcAlpha OneMinusSrcAlpha 42 | ColorMask [_ColorMask] 43 | 44 | Pass 45 | { 46 | CGPROGRAM 47 | #pragma vertex vert 48 | #pragma fragment frag 49 | #include "UnityCG.cginc" 50 | 51 | struct appdata_t 52 | { 53 | float4 vertex : POSITION; 54 | float4 color : COLOR; 55 | float2 texcoord : TEXCOORD0; 56 | UNITY_VERTEX_INPUT_INSTANCE_ID 57 | }; 58 | 59 | struct v2f 60 | { 61 | float4 vertex : SV_POSITION; 62 | fixed4 color : COLOR; 63 | half2 texcoord : TEXCOORD0; 64 | UNITY_VERTEX_OUTPUT_STEREO 65 | }; 66 | 67 | fixed4 _Color; 68 | 69 | v2f vert(appdata_t IN) 70 | { 71 | UNITY_SETUP_INSTANCE_ID(IN); 72 | 73 | v2f OUT; 74 | OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); 75 | OUT.texcoord = IN.texcoord; 76 | #ifdef UNITY_HALF_TEXEL_OFFSET 77 | OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1); 78 | #endif 79 | OUT.color = IN.color * _Color; 80 | 81 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 82 | return OUT; 83 | } 84 | 85 | sampler2D _MainTex; 86 | 87 | fixed4 frag(v2f IN) : SV_Target 88 | { 89 | half4 color = tex2D(_MainTex, IN.texcoord) * IN.color; 90 | clip (color.a - 0.01); 91 | return color; 92 | } 93 | ENDCG 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Meshes/button_test_msh.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Meshes/button_test_msh.fbx -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/ButtonObjectScaler.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule.Tests 7 | { 8 | public class ButtonObjectScaler : MonoBehaviour 9 | { 10 | [SerializeField] 11 | private TestButton button = null; 12 | 13 | [SerializeField] 14 | private GameObject ObjectToScale = null; 15 | 16 | [SerializeField] 17 | private float ScaleIncrement = 1.0f; 18 | 19 | [SerializeField] 20 | private buttonAction ButtonAction = buttonAction.Reset; 21 | 22 | private enum buttonAction { Reset, Grow, Shrink }; 23 | 24 | private Vector3 InitialScale; 25 | 26 | private void Start() 27 | { 28 | if (ObjectToScale) 29 | { 30 | InitialScale = ObjectToScale.transform.localScale; 31 | } 32 | } 33 | 34 | private void OnEnable() 35 | { 36 | button.Activated += OnButtonPressed; 37 | } 38 | 39 | private void OnDisable() 40 | { 41 | button.Activated -= OnButtonPressed; 42 | } 43 | 44 | private void OnButtonPressed(TestButton source) 45 | { 46 | if (ObjectToScale) 47 | { 48 | switch (ButtonAction) 49 | { 50 | case buttonAction.Reset: 51 | Debug.Log(InitialScale); 52 | ObjectToScale.transform.localScale = InitialScale; 53 | break; 54 | case buttonAction.Grow: 55 | ObjectToScale.transform.localScale = new Vector3((ObjectToScale.transform.localScale.x + ScaleIncrement), (ObjectToScale.transform.localScale.y + ScaleIncrement), (ObjectToScale.transform.localScale.z + ScaleIncrement)); 56 | break; 57 | case buttonAction.Shrink: 58 | if ((ObjectToScale.transform.localScale.x - ScaleIncrement) < 0.0f) 59 | { 60 | ObjectToScale.transform.localScale = new Vector3(0, 0, 0); 61 | } 62 | else 63 | { 64 | ObjectToScale.transform.localScale = new Vector3((ObjectToScale.transform.localScale.x - ScaleIncrement), (ObjectToScale.transform.localScale.y - ScaleIncrement), (ObjectToScale.transform.localScale.z - ScaleIncrement)); 65 | } 66 | break; 67 | } 68 | } 69 | 70 | button.Selected = false; 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/ButtonTimedWaiter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System.Collections; 5 | using UnityEngine; 6 | 7 | namespace HoloToolkit.Unity.InputModule.Tests 8 | { 9 | public class ButtonTimedWaiter : MonoBehaviour 10 | { 11 | [SerializeField] 12 | private TestButton button = null; 13 | 14 | [SerializeField] 15 | private float TimeToWait = 1.0f; 16 | 17 | [SerializeField] 18 | private TextMesh textMesh = null; 19 | 20 | private void Awake() 21 | { 22 | button.Activated += OnButtonPressed; 23 | } 24 | 25 | private void OnDisable() 26 | { 27 | button.Activated -= OnButtonPressed; 28 | } 29 | 30 | private void OnButtonPressed(TestButton source) 31 | { 32 | InputManager.Instance.PushInputDisable(); 33 | StartCoroutine(WaitForTime(TimeToWait)); 34 | } 35 | 36 | IEnumerator WaitForTime(float timeToWait) 37 | { 38 | float currentTime = 0.0f; 39 | 40 | while (currentTime <= timeToWait) 41 | { 42 | currentTime += Time.deltaTime; 43 | textMesh.text = ((currentTime / timeToWait) * 100.0f).ToString("F0") + "%"; 44 | yield return null; 45 | } 46 | 47 | InputManager.Instance.PopInputDisable(); 48 | button.Selected = false; 49 | textMesh.text = "Wait"; 50 | 51 | yield break; 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/DehydrationDeactivation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule.Tests 7 | { 8 | public class DehydrationDeactivation : StateMachineBehaviour 9 | { 10 | /// 11 | /// OnStateExit is called when a transition ends and the state machine finishes evaluating this state 12 | /// 13 | /// Animator that triggered OnStateEnter. 14 | /// Animator state info. 15 | /// Layer index. 16 | public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) 17 | { 18 | animator.transform.gameObject.SetActive(false); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/DisplayKeywords.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace HoloToolkit.Unity.InputModule.Tests 8 | { 9 | public class DisplayKeywords : MonoBehaviour 10 | { 11 | public KeywordManager keywordManager; 12 | public Text textPanel; 13 | 14 | void Start() 15 | { 16 | if (keywordManager == null || textPanel == null) 17 | { 18 | Debug.Log("Please check the variables in the Inspector on DisplayKeywords.cs on" + name + "."); 19 | return; 20 | } 21 | 22 | textPanel.text = "Try saying:\n"; 23 | foreach (KeywordManager.KeywordAndResponse k in keywordManager.KeywordsAndResponses) 24 | { 25 | textPanel.text += k.Keyword + "\n"; 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/DisplaySpeechKeywords.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | namespace HoloToolkit.Unity.InputModule.Tests 8 | { 9 | public class DisplaySpeechKeywords : MonoBehaviour 10 | { 11 | public SpeechInputSource speechInputSource; 12 | public TextMesh textMesh; 13 | 14 | private void Start() 15 | { 16 | if (speechInputSource == null || textMesh == null) 17 | { 18 | Debug.Log("Please check the variables in the Inspector on DisplaySpeechKeywords.cs on" + name + "."); 19 | return; 20 | } 21 | 22 | textMesh.text = "Try saying:\n"; 23 | foreach (SpeechInputSource.KeywordAndKeyCode item in speechInputSource.Keywords) 24 | { 25 | textMesh.text += " " + item.Keyword + "\n"; 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/FocusedObjectColorChanger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace HoloToolkit.Unity.InputModule.Tests 4 | { 5 | /// 6 | /// FocusedObjectMessageReceiver class shows how to handle focus events. 7 | /// This particular implementatoin controls object appearance by changing its color when focused. 8 | /// 9 | [RequireComponent(typeof(Renderer))] 10 | public class FocusedObjectColorChanger : MonoBehaviour, IFocusable 11 | { 12 | [Tooltip("Object color changes to this when focused.")] 13 | public Color FocusedColor = Color.red; 14 | 15 | private Color originalColor; 16 | private Material cachedMaterial; 17 | 18 | private void Awake() 19 | { 20 | cachedMaterial = GetComponent().material; 21 | originalColor = cachedMaterial.GetColor("_Color"); 22 | } 23 | 24 | public void OnFocusEnter() 25 | { 26 | cachedMaterial.SetColor("_Color", FocusedColor); 27 | } 28 | 29 | public void OnFocusExit() 30 | { 31 | cachedMaterial.SetColor("_Color", originalColor); 32 | } 33 | 34 | private void OnDestroy() 35 | { 36 | DestroyImmediate(cachedMaterial); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/FocusedObjectMessageSender.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace HoloToolkit.Unity.InputModule.Tests 4 | { 5 | /// 6 | /// FocusedObjectMessageSender class sends Unity message to object currently focused on by GazeManager. 7 | /// Focused object messages can be triggered using voice commands, so keyword responses 8 | /// need to be registered in KeywordManager. 9 | /// 10 | public class FocusedObjectMessageSender : MonoBehaviour 11 | { 12 | /// 13 | /// Sends message to the object currently focused on by GazeManager. 14 | /// 15 | /// Message to send 16 | public void SendMessageToFocusedObject(string message) 17 | { 18 | if (GazeManager.Instance.HitObject != null) 19 | { 20 | GazeManager.Instance.HitObject.SendMessage(message, SendMessageOptions.DontRequireReceiver); 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/GazeResponder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule.Tests 7 | { 8 | /// 9 | /// This class implements IFocusable to respond to gaze changes. 10 | /// It highlights the object being gazed at. 11 | /// 12 | public class GazeResponder : MonoBehaviour, IFocusable 13 | { 14 | private Material[] defaultMaterials; 15 | 16 | private void Start() 17 | { 18 | defaultMaterials = GetComponent().materials; 19 | } 20 | 21 | public void OnFocusEnter() 22 | { 23 | for (int i = 0; i < defaultMaterials.Length; i++) 24 | { 25 | // Highlight the material when gaze enters using the shader property. 26 | defaultMaterials[i].SetFloat("_Highlight", .5f); 27 | } 28 | } 29 | 30 | public void OnFocusExit() 31 | { 32 | for (int i = 0; i < defaultMaterials.Length; i++) 33 | { 34 | // Remove highlight on material when gaze exits. 35 | defaultMaterials[i].SetFloat("_Highlight", 0f); 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/InputHandleCallbackFX.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule.Tests 7 | { 8 | public class InputHandleCallbackFX : MonoBehaviour, IInputClickHandler 9 | { 10 | [SerializeField] 11 | private ParticleSystem particles = null; 12 | 13 | private void Start() 14 | { 15 | InputManager.Instance.PushFallbackInputHandler(gameObject); 16 | } 17 | 18 | public void OnInputClicked(InputEventData eventData) 19 | { 20 | particles.transform.position = GazeManager.Instance.HitPosition; 21 | particles.Emit(60); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/OnFocusEvent.cs: -------------------------------------------------------------------------------- 1 | using HoloToolkit.Unity.InputModule; 2 | using UnityEngine; 3 | using UnityEngine.Events; 4 | 5 | namespace HoloToolkit.Unity.InputModule.Tests 6 | { 7 | public class OnFocusEvent : MonoBehaviour, IFocusable 8 | { 9 | public UnityEvent FocusEnterEvent; 10 | public UnityEvent FocusLostEvent; 11 | 12 | private void Start() 13 | { 14 | // dummy Start function so we can use this.enabled 15 | } 16 | 17 | public void OnFocusEnter() 18 | { 19 | if (this.enabled == false) return; 20 | if (FocusEnterEvent != null) 21 | { 22 | FocusEnterEvent.Invoke(); 23 | } 24 | } 25 | 26 | public void OnFocusExit() 27 | { 28 | if (this.enabled == false) return; 29 | if (FocusLostEvent != null) 30 | { 31 | FocusLostEvent.Invoke(); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/ScaleObjectMessageReceiver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace HoloToolkit.Unity.InputModule.Tests 4 | { 5 | public class ScaleObjectMessageReceiver : MonoBehaviour 6 | { 7 | private const float DefaultSizeFactor = 2.0f; 8 | 9 | [Tooltip("Size multiplier to use when scaling the object up and down.")] 10 | public float SizeFactor = DefaultSizeFactor; 11 | 12 | private void Start() 13 | { 14 | if (SizeFactor <= 0.0f) 15 | { 16 | SizeFactor = DefaultSizeFactor; 17 | } 18 | } 19 | 20 | public void OnMakeBigger() 21 | { 22 | Vector3 scale = transform.localScale; 23 | scale *= SizeFactor; 24 | transform.localScale = scale; 25 | } 26 | 27 | public void OnMakeSmaller() 28 | { 29 | Vector3 scale = transform.localScale; 30 | scale /= SizeFactor; 31 | transform.localScale = scale; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/SelectedObjectMessageReceiver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace HoloToolkit.Unity.InputModule.Tests 4 | { 5 | /// 6 | /// SelectedObjectMessageReceiver class shows how to handle messages sent by SelectedObjectMessageSender. 7 | /// This particular implementatoin controls object appearance by changing its color when selected. 8 | /// 9 | [RequireComponent(typeof(Renderer))] 10 | public class SelectedObjectMessageReceiver : MonoBehaviour 11 | { 12 | [Tooltip("Object color changes to this when selected.")] 13 | public Color SelectedColor = Color.red; 14 | 15 | private Color originalColor; 16 | private Material cachedMaterial; 17 | 18 | private void Awake() 19 | { 20 | cachedMaterial = GetComponent().material; 21 | originalColor = cachedMaterial.GetColor("_Color"); 22 | } 23 | 24 | public void OnSelectObject() 25 | { 26 | cachedMaterial.SetColor("_Color", SelectedColor); 27 | } 28 | 29 | public void OnClearSelection() 30 | { 31 | cachedMaterial.SetColor("_Color", originalColor); 32 | } 33 | 34 | private void OnDestroy() 35 | { 36 | DestroyImmediate(cachedMaterial); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/SelectedObjectMessageSender.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace HoloToolkit.Unity.InputModule.Tests 4 | { 5 | /// 6 | /// SelectedObjectMessageSender class sends a Unity message to currently selected object. 7 | /// Object selection is controlled via OnSelectObject and OnClearSelection events. 8 | /// Object selection and messages are triggered using voice commands, so keyword responses 9 | /// need to be registered in KeywordManager. 10 | /// 11 | public class SelectedObjectMessageSender : MonoBehaviour 12 | { 13 | /// 14 | /// Currently selected object. 15 | /// 16 | private GameObject selectedObject; 17 | 18 | /// 19 | /// Sets selection to currently focused object. 20 | /// 21 | public void OnSelectObject() 22 | { 23 | OnClearSelection(); 24 | selectedObject = GazeManager.Instance.HitObject; 25 | SendMessageToSelectedObject("OnSelectObject"); 26 | } 27 | 28 | /// 29 | /// Clears currently selected object. 30 | /// 31 | public void OnClearSelection() 32 | { 33 | SendMessageToSelectedObject("OnClearSelection"); 34 | selectedObject = null; 35 | } 36 | 37 | /// 38 | /// Sends message to currently selected object. 39 | /// 40 | /// Message to send 41 | public void SendMessageToSelectedObject(string message) 42 | { 43 | if (selectedObject != null) 44 | { 45 | selectedObject.SendMessage(message, SendMessageOptions.DontRequireReceiver); 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/SimpleGridGenerator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace HoloToolkit.Unity.InputModule.Tests 5 | { 6 | public class SimpleGridGenerator : MonoBehaviour 7 | { 8 | private const int DefaultRows = 3; 9 | private const int DefaultColumns = 3; 10 | 11 | [Tooltip("Number of rows in the grid.")] 12 | public int Rows = DefaultRows; 13 | 14 | [Tooltip("Number of columns in the grid.")] 15 | public int Columns = DefaultColumns; 16 | 17 | [Tooltip("Distance between objects in the grid.")] 18 | public float ObjectSpacing = 1.0f; 19 | 20 | [Tooltip("Array of object prefabs to instantiate on the grid.")] 21 | public List ObjectPrefabs; 22 | 23 | [Tooltip("Indicates whether to generate grid on component start.")] 24 | public bool GenerateOnStart = true; 25 | 26 | private void Start() 27 | { 28 | if (GenerateOnStart) 29 | { 30 | GenerateGrid(); 31 | } 32 | } 33 | 34 | public void GenerateGrid() 35 | { 36 | float startX = -0.5f * ObjectSpacing * (Rows - 1); 37 | float startY = -0.5f * ObjectSpacing * (Columns - 1); 38 | for (int i = 0; i < Rows; i++) 39 | { 40 | for (int j = 0; j < Columns; j++) 41 | { 42 | GameObject prefab = GetRandomPrefab(); 43 | Vector3 pos = new Vector3(startX + i * ObjectSpacing, startY + j * ObjectSpacing, 0.0f); 44 | GameObject go = Instantiate(prefab, pos, Quaternion.identity) as GameObject; 45 | go.transform.SetParent(transform, false); 46 | } 47 | } 48 | } 49 | 50 | private GameObject GetRandomPrefab() 51 | { 52 | if (ObjectPrefabs.Count > 0) 53 | { 54 | int index = Random.Range(0, ObjectPrefabs.Count); 55 | return ObjectPrefabs[index]; 56 | } 57 | return null; 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/SphereGlobalKeywords.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule.Tests 7 | { 8 | public class SphereGlobalKeywords : MonoBehaviour, ISpeechHandler 9 | { 10 | private Material[] cachedChildMaterials; 11 | 12 | private void Awake() 13 | { 14 | Renderer[] childRenderers = GetComponentsInChildren(); 15 | if (childRenderers != null && childRenderers.Length > 0) 16 | { 17 | cachedChildMaterials = new Material[childRenderers.Length]; 18 | for (int i = 0; i < childRenderers.Length; i++) 19 | { 20 | cachedChildMaterials[i] = childRenderers[i].material; 21 | } 22 | } 23 | } 24 | 25 | public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) 26 | { 27 | switch (eventData.RecognizedText.ToLower()) 28 | { 29 | case "reset all": 30 | foreach (Material cachedChildMaterial in cachedChildMaterials) 31 | { 32 | cachedChildMaterial.SetColor("_Color", Color.gray); 33 | } 34 | break; 35 | } 36 | } 37 | 38 | private void OnDestroy() 39 | { 40 | for (int i = 0; i < cachedChildMaterials.Length; i++) 41 | { 42 | DestroyImmediate(cachedChildMaterials[i]); 43 | } 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/SphereKeywords.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule.Tests 7 | { 8 | [RequireComponent(typeof(Renderer))] 9 | public class SphereKeywords : MonoBehaviour, ISpeechHandler 10 | { 11 | private Material cachedMaterial; 12 | 13 | private void Awake() 14 | { 15 | cachedMaterial = GetComponent().material; 16 | } 17 | 18 | public void ChangeColor(string color) 19 | { 20 | switch (color.ToLower()) 21 | { 22 | case "red": 23 | cachedMaterial.SetColor("_Color", Color.red); 24 | break; 25 | case "blue": 26 | cachedMaterial.SetColor("_Color", Color.blue); 27 | break; 28 | case "green": 29 | cachedMaterial.SetColor("_Color", Color.green); 30 | break; 31 | } 32 | } 33 | 34 | public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) 35 | { 36 | ChangeColor(eventData.RecognizedText); 37 | } 38 | 39 | private void OnDestroy() 40 | { 41 | DestroyImmediate(cachedMaterial); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/TapResponder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity.InputModule.Tests 7 | { 8 | /// 9 | /// This class implements IInputClickHandler to handle the tap gesture. 10 | /// It increases the scale of the object when tapped. 11 | /// 12 | public class TapResponder : MonoBehaviour, IInputClickHandler 13 | { 14 | public void OnInputClicked(InputEventData eventData) 15 | { 16 | // Increase the scale of the object just as a response. 17 | gameObject.transform.localScale += 0.05f * gameObject.transform.localScale; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Scripts/TogglePopupMenu.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using System.Collections; 6 | 7 | namespace HoloToolkit.Unity.InputModule.Tests 8 | { 9 | public class TogglePopupMenu : MonoBehaviour 10 | { 11 | 12 | [SerializeField] 13 | private PopupMenu popupMenu = null; 14 | 15 | [SerializeField] 16 | private TestButton button = null; 17 | 18 | private void Awake() 19 | { 20 | if (button) 21 | { 22 | button.Activated += ShowPopup; 23 | } 24 | } 25 | 26 | private void OnDisable() 27 | { 28 | if (button) 29 | { 30 | button.Activated -= ShowPopup; 31 | } 32 | } 33 | 34 | private void ShowPopup(TestButton source) 35 | { 36 | if (popupMenu != null) 37 | { 38 | if (popupMenu.CurrentPopupState == PopupMenu.PopupState.Closed) 39 | { 40 | popupMenu.Show(); 41 | 42 | StartCoroutine(WaitForPopupToClose()); 43 | } 44 | } 45 | } 46 | 47 | private IEnumerator WaitForPopupToClose() 48 | { 49 | if (popupMenu) 50 | { 51 | while (popupMenu.CurrentPopupState == PopupMenu.PopupState.Open) 52 | { 53 | yield return null; 54 | } 55 | } 56 | 57 | if (button) 58 | { 59 | button.Selected = false; 60 | } 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Shaders/SkyboxProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Shaders/SkyboxProbe-0.exr -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Textures/button_test_cubemap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Input/Tests/Textures/button_test_cubemap.tga -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/UI/Prefabs/3DTextPrefab.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000013198843976} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000013198843976 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000010330146594} 22 | - 23: {fileID: 23000013318538408} 23 | - 102: {fileID: 102000010767390410} 24 | m_Layer: 0 25 | m_Name: 3DTextPrefab 26 | m_TagString: Untagged 27 | m_Icon: {fileID: 0} 28 | m_NavMeshLayer: 0 29 | m_StaticEditorFlags: 0 30 | m_IsActive: 1 31 | --- !u!4 &4000010330146594 32 | Transform: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 1000013198843976} 37 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 38 | m_LocalPosition: {x: 0.18989998, y: 0.09199999, z: 2} 39 | m_LocalScale: {x: 0.005, y: 0.005, z: 0.005} 40 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 41 | m_Children: [] 42 | m_Father: {fileID: 0} 43 | m_RootOrder: 0 44 | --- !u!23 &23000013318538408 45 | MeshRenderer: 46 | m_ObjectHideFlags: 1 47 | m_PrefabParentObject: {fileID: 0} 48 | m_PrefabInternal: {fileID: 100100000} 49 | m_GameObject: {fileID: 1000013198843976} 50 | m_Enabled: 1 51 | m_CastShadows: 1 52 | m_ReceiveShadows: 1 53 | m_MotionVectors: 1 54 | m_LightProbeUsage: 1 55 | m_ReflectionProbeUsage: 1 56 | m_Materials: 57 | - {fileID: 2100000, guid: e0ae5e7fdc160f5489f88af6b29bd137, type: 2} 58 | m_SubsetIndices: 59 | m_StaticBatchRoot: {fileID: 0} 60 | m_ProbeAnchor: {fileID: 0} 61 | m_LightProbeVolumeOverride: {fileID: 0} 62 | m_ScaleInLightmap: 1 63 | m_PreserveUVs: 0 64 | m_IgnoreNormalsForChartDetection: 0 65 | m_ImportantGI: 0 66 | m_SelectedWireframeHidden: 0 67 | m_MinimumChartSize: 4 68 | m_AutoUVMaxDistance: 0.5 69 | m_AutoUVMaxAngle: 89 70 | m_LightmapParameters: {fileID: 0} 71 | m_SortingLayerID: 0 72 | m_SortingOrder: 0 73 | --- !u!102 &102000010767390410 74 | TextMesh: 75 | serializedVersion: 3 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000013198843976} 80 | m_Text: 3D Text Prefab 81 | m_OffsetZ: 0 82 | m_CharacterSize: 1 83 | m_LineSpacing: 1 84 | m_Anchor: 4 85 | m_Alignment: 1 86 | m_TabSize: 4 87 | m_FontSize: 48 88 | m_FontStyle: 0 89 | m_RichText: 1 90 | m_Font: {fileID: 12800000, guid: fde1cf694167a874298395a40d21f342, type: 3} 91 | m_Color: 92 | serializedVersion: 2 93 | rgba: 4294967295 94 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/UI/Shaders/3DTextShader.shader: -------------------------------------------------------------------------------- 1 | Shader "HoloToolkit/3DTextShader"{ 2 | Properties{ 3 | _MainTex("Font Texture", 2D) = "white" {} 4 | _Color("Text Color", Color) = (1,1,1,1) 5 | } 6 | 7 | SubShader{ 8 | Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } 9 | Lighting Off Cull Off ZWrite Off Fog{ Mode Off } 10 | Blend SrcAlpha OneMinusSrcAlpha 11 | Pass{ 12 | Color[_Color] 13 | SetTexture[_MainTex]{ 14 | combine primary, texture * primary 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Editor/AutoConfigureMenu.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using System.IO; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | using UnityEditor; 9 | using UnityEngine; 10 | 11 | namespace HoloToolkit.Unity 12 | { 13 | /// 14 | /// Configuration options derived from here: 15 | /// https://developer.microsoft.com/en-us/windows/holographic/unity_development_overview#Configuring_a_Unity_project_for_HoloLens 16 | /// 17 | 18 | 19 | public class AutoConfigureMenu : MonoBehaviour 20 | { 21 | /// 22 | /// Displays a help page for the HoloToolkit. 23 | /// 24 | [MenuItem("HoloToolkit/Configure/Show Help", false, 3)] 25 | public static void ShowHelp() 26 | { 27 | Application.OpenURL("https://github.com/Microsoft/HoloToolkit-Unity/wiki"); 28 | } 29 | 30 | /// 31 | /// Applies recommended scene settings to the current scenes 32 | /// 33 | [MenuItem("HoloToolkit/Configure/Apply HoloLens Scene Settings", false, 1)] 34 | public static void ApplySceneSettings() 35 | { 36 | SceneSettingsWindow window = (SceneSettingsWindow)EditorWindow.GetWindow(typeof(SceneSettingsWindow), true, "Apply HoloLens Scene Settings"); 37 | window.Show(); 38 | } 39 | 40 | /// 41 | /// Applies recommended project settings to the current project 42 | /// 43 | [MenuItem("HoloToolkit/Configure/Apply HoloLens Project Settings", false, 1)] 44 | public static void ApplyProjectSettings() 45 | { 46 | ProjectSettingsWindow window = (ProjectSettingsWindow)EditorWindow.GetWindow(typeof(ProjectSettingsWindow), true, "Apply HoloLens Project Settings"); 47 | window.Show(); 48 | } 49 | 50 | /// 51 | /// Applies recommended capability settings to the current project 52 | /// 53 | [MenuItem("HoloToolkit/Configure/Apply HoloLens Capability Settings", false, 2)] 54 | static void ApplyHoloLensCapabilitySettings() 55 | { 56 | CapabilitySettingsWindow window = (CapabilitySettingsWindow)EditorWindow.GetWindow(typeof(CapabilitySettingsWindow), true, "Apply HoloLens Capability Settings"); 57 | window.Show(); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Editor/EnforceEditorSettings.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEditor; 5 | 6 | namespace HoloToolKit.Unity 7 | { 8 | [InitializeOnLoad] 9 | public class EnforceEditorSettings 10 | { 11 | static EnforceEditorSettings() 12 | { 13 | #region Editor Settings 14 | 15 | if (EditorSettings.serializationMode != SerializationMode.ForceText) 16 | { 17 | EditorSettings.serializationMode = SerializationMode.ForceText; 18 | UnityEngine.Debug.Log("Setting Force Text Serialization"); 19 | } 20 | 21 | if (!EditorSettings.externalVersionControl.Equals("Visible Meta Files")) 22 | { 23 | EditorSettings.externalVersionControl = "Visible Meta Files"; 24 | UnityEngine.Debug.Log("Updated external version control mode: " + EditorSettings.externalVersionControl); 25 | } 26 | 27 | #endregion 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Editor/LayerMaskExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace HoloToolkit.Unity 8 | { 9 | /// 10 | /// Extensions for the UnityEngine.LayerMask class. 11 | /// 12 | public static class LayerMaskExtensions 13 | { 14 | public const int LayerCount = 32; 15 | 16 | private static string[] layerMaskNames = null; 17 | public static string[] LayerMaskNames 18 | { 19 | get 20 | { 21 | if (layerMaskNames == null) 22 | { 23 | LayerMaskExtensions.layerMaskNames = new string[LayerCount]; 24 | for (int layer = 0; layer < LayerCount; ++layer) 25 | { 26 | LayerMaskExtensions.layerMaskNames[layer] = LayerMask.LayerToName(layer); 27 | } 28 | } 29 | 30 | return LayerMaskExtensions.layerMaskNames; 31 | } 32 | } 33 | 34 | public static string GetDisplayString(this LayerMask layerMask) 35 | { 36 | StringBuilder stringBuilder = null; 37 | for (int layer = 0; layer < LayerMaskExtensions.LayerCount; ++layer) 38 | { 39 | if ((layerMask & (1 << layer)) != 0) 40 | { 41 | if (stringBuilder == null) 42 | { 43 | stringBuilder = new StringBuilder(); 44 | } 45 | else 46 | { 47 | stringBuilder.Append(" | "); 48 | } 49 | 50 | stringBuilder.Append(LayerMaskExtensions.LayerMaskNames[layer]); 51 | } 52 | } 53 | 54 | return stringBuilder == null ? "None" : stringBuilder.ToString(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Prefabs/HeadsUpDirectionIndicator.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000012707223274} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000012707223274 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000013931524940} 22 | - 114: {fileID: 114000010146961468} 23 | m_Layer: 0 24 | m_Name: HeadsUpDirectionIndicator 25 | m_TagString: Untagged 26 | m_Icon: {fileID: 0} 27 | m_NavMeshLayer: 0 28 | m_StaticEditorFlags: 0 29 | m_IsActive: 1 30 | --- !u!4 &4000013931524940 31 | Transform: 32 | m_ObjectHideFlags: 1 33 | m_PrefabParentObject: {fileID: 0} 34 | m_PrefabInternal: {fileID: 100100000} 35 | m_GameObject: {fileID: 1000012707223274} 36 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 37 | m_LocalPosition: {x: 0, y: 0, z: 0} 38 | m_LocalScale: {x: 1, y: 1, z: 1} 39 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 40 | m_Children: [] 41 | m_Father: {fileID: 0} 42 | m_RootOrder: 0 43 | --- !u!114 &114000010146961468 44 | MonoBehaviour: 45 | m_ObjectHideFlags: 1 46 | m_PrefabParentObject: {fileID: 0} 47 | m_PrefabInternal: {fileID: 100100000} 48 | m_GameObject: {fileID: 1000012707223274} 49 | m_Enabled: 1 50 | m_EditorHideFlags: 0 51 | m_Script: {fileID: 11500000, guid: aaf540edf943b014c9b1cb13622dd844, type: 3} 52 | m_Name: 53 | m_EditorClassIdentifier: 54 | TargetObject: {fileID: 0} 55 | Depth: 15 56 | Pivot: {x: 0, y: 0.5, z: 0} 57 | PointerPrefab: {fileID: 1000013959014570, guid: 6145c0073e089ec44ade2d6ee028ae9b, 58 | type: 2} 59 | IndicatorMarginPercent: 0.1 60 | DebugDrawPointerOrientationPlanes: 0 61 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Prefabs/HeadsUpDirectionIndicatorPointer.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000013959014570} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000013959014570 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000014200002438} 22 | - 33: {fileID: 33000013990238068} 23 | - 64: {fileID: 64000012096101712} 24 | - 23: {fileID: 23000012460074050} 25 | m_Layer: 0 26 | m_Name: HeadsUpDirectionIndicatorPointer 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000014200002438 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000013959014570} 38 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 39 | m_LocalPosition: {x: 0, y: 0, z: 0} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!23 &23000012460074050 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000013959014570} 51 | m_Enabled: 1 52 | m_CastShadows: 0 53 | m_ReceiveShadows: 0 54 | m_MotionVectors: 0 55 | m_LightProbeUsage: 0 56 | m_ReflectionProbeUsage: 0 57 | m_Materials: 58 | - {fileID: 2100000, guid: 5238ed24c9726a1459b60cb16df01a9d, type: 2} 59 | m_SubsetIndices: 60 | m_StaticBatchRoot: {fileID: 0} 61 | m_ProbeAnchor: {fileID: 0} 62 | m_LightProbeVolumeOverride: {fileID: 0} 63 | m_ScaleInLightmap: 1 64 | m_PreserveUVs: 1 65 | m_IgnoreNormalsForChartDetection: 0 66 | m_ImportantGI: 0 67 | m_SelectedWireframeHidden: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingOrder: 0 74 | --- !u!33 &33000013990238068 75 | MeshFilter: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000013959014570} 80 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 81 | --- !u!64 &64000012096101712 82 | MeshCollider: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1000013959014570} 87 | m_Material: {fileID: 0} 88 | m_IsTrigger: 0 89 | m_Enabled: 1 90 | serializedVersion: 2 91 | m_Convex: 0 92 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 93 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/Billboard.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity 7 | { 8 | public enum PivotAxis 9 | { 10 | // Rotate about all axes. 11 | Free, 12 | // Rotate about an individual axis. 13 | Y 14 | } 15 | 16 | /// 17 | /// The Billboard class implements the behaviors needed to keep a GameObject 18 | /// oriented towards the user. 19 | /// 20 | public class Billboard : MonoBehaviour 21 | { 22 | /// 23 | /// The axis about which the object will rotate. 24 | /// 25 | [Tooltip("Specifies the axis about which the object will rotate.")] 26 | public PivotAxis PivotAxis = PivotAxis.Free; 27 | 28 | private void OnEnable() 29 | { 30 | Update(); 31 | } 32 | 33 | /// 34 | /// Keeps the object facing the camera. 35 | /// 36 | private void Update() 37 | { 38 | if (!Camera.main) 39 | { 40 | return; 41 | } 42 | 43 | // Get a Vector that points from the target to the main camera. 44 | Vector3 directionToTarget = Camera.main.transform.position - transform.position; 45 | 46 | // Adjust for the pivot axis. 47 | switch (PivotAxis) 48 | { 49 | case PivotAxis.Y: 50 | directionToTarget.y = 0.0f; 51 | break; 52 | 53 | case PivotAxis.Free: 54 | default: 55 | // No changes needed. 56 | break; 57 | } 58 | 59 | // If we are right next to the camera the rotation is undefined. 60 | if (directionToTarget.sqrMagnitude < 0.001f) 61 | { 62 | return; 63 | } 64 | 65 | // Calculate and apply the rotation required to reorient the object 66 | transform.rotation = Quaternion.LookRotation(-directionToTarget); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/Extensions/ActionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace HoloToolkit.Unity 7 | { 8 | /// 9 | /// Extensions for the action class. 10 | /// These methods encapsulate the null check before raising an event for an Action. 11 | /// 12 | public static class ActionExtensions 13 | { 14 | public static void RaiseEvent(this Action action) 15 | { 16 | if (action != null) 17 | { 18 | action(); 19 | } 20 | } 21 | 22 | public static void RaiseEvent(this Action action, T arg) 23 | { 24 | if (action != null) 25 | { 26 | action(arg); 27 | } 28 | } 29 | 30 | public static void RaiseEvent(this Action action, T1 arg1, T2 arg2) 31 | { 32 | if (action != null) 33 | { 34 | action(arg1, arg2); 35 | } 36 | } 37 | 38 | public static void RaiseEvent(this Action action, T1 arg1, T2 arg2, T3 arg3) 39 | { 40 | if (action != null) 41 | { 42 | action(arg1, arg2, arg3); 43 | } 44 | } 45 | 46 | public static void RaiseEvent(this Action action, T1 arg1, T2 arg2, T3 arg3, T4 arg4) 47 | { 48 | if (action != null) 49 | { 50 | action(arg1, arg2, arg3, arg4); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/Extensions/Extensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // 4 | 5 | using UnityEngine; 6 | 7 | namespace HoloToolkit.Unity 8 | { 9 | /// 10 | /// A class with general purpose extensions methods. 11 | /// 12 | public static class Extensions 13 | { 14 | /// 15 | /// Returns the absolute duration of the curve from first to last key frame 16 | /// 17 | /// The animation curve to check duration of. 18 | /// Returns 0 if the curve is null or has less than 1 frame, otherwise returns time difference between first and last frame. 19 | public static float Duration(this AnimationCurve curve) 20 | { 21 | if (curve == null || curve.length <= 1) 22 | { 23 | return 0.0f; 24 | } 25 | 26 | return Mathf.Abs(curve[curve.length - 1].time - curve[0].time); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/Extensions/TransformExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace HoloToolkit.Unity 8 | { 9 | public static class TransformExtensions 10 | { 11 | /// 12 | /// An extension method that will get you the full path to an object. 13 | /// 14 | /// The transform you wish a full path to. 15 | /// The delimiter with which each object is delimited in the string. 16 | /// Prefix with which the full path to the object should start. 17 | /// A delimited string that is the full path to the game object in the hierarchy. 18 | public static string GetFullPath(this Transform transform, string delimiter = ".", string prefix = "/") 19 | { 20 | StringBuilder stringBuilder = new StringBuilder(); 21 | GetFullPath(stringBuilder, transform, delimiter, prefix); 22 | return stringBuilder.ToString(); 23 | } 24 | 25 | private static void GetFullPath(StringBuilder stringBuilder, Transform transform, string delimiter, string prefix) 26 | { 27 | if (transform.parent == null) 28 | { 29 | stringBuilder.Append(prefix); 30 | } 31 | else 32 | { 33 | GetFullPath(stringBuilder, transform.parent, delimiter, prefix); 34 | stringBuilder.Append(delimiter); 35 | } 36 | stringBuilder.Append(transform.name); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/InterpolationUtilities.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity 7 | { 8 | /// 9 | /// Static class containing interpolation-related utility functions. 10 | /// 11 | public static class InterpolationUtilities 12 | { 13 | #region Exponential Decay 14 | 15 | public static float ExpDecay(float from, float to, float hLife, float dTime) 16 | { 17 | return Mathf.Lerp(from, to, ExpCoefficient(hLife, dTime)); 18 | } 19 | 20 | public static Vector2 ExpDecay(Vector2 from, Vector2 to, float hLife, float dTime) 21 | { 22 | return Vector2.Lerp(from, to, ExpCoefficient(hLife, dTime)); 23 | } 24 | 25 | public static Vector3 ExpDecay(Vector3 from, Vector3 to, float hLife, float dTime) 26 | { 27 | return Vector3.Lerp(from, to, ExpCoefficient(hLife, dTime)); 28 | } 29 | 30 | public static Quaternion ExpDecay(Quaternion from, Quaternion to, float hLife, float dTime) 31 | { 32 | return Quaternion.Slerp(from, to, ExpCoefficient(hLife, dTime)); 33 | } 34 | 35 | public static Color ExpDecay(Color from, Color to, float hLife, float dTime) 36 | { 37 | return Color.Lerp(from, to, ExpCoefficient(hLife, dTime)); 38 | } 39 | 40 | 41 | public static float ExpCoefficient(float hLife, float dTime) 42 | { 43 | if (hLife == 0) 44 | return 1; 45 | 46 | return 1.0f - Mathf.Pow(0.5f, dTime/hLife); 47 | } 48 | 49 | #endregion 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/NearPlaneFade.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity 7 | { 8 | [ExecuteInEditMode] 9 | public class NearPlaneFade : MonoBehaviour 10 | { 11 | public float FadeDistanceStart = 0.85f; 12 | public float FadeDistanceEnd = 0.5f; 13 | 14 | public bool NearPlaneFadeOn = true; 15 | 16 | private const string FadeKeywordOn = "_NEAR_PLANE_FADE_ON"; 17 | 18 | private int fadeDistancePropertyID; 19 | 20 | private void Start() 21 | { 22 | fadeDistancePropertyID = Shader.PropertyToID("_NearPlaneFadeDistance"); 23 | UpdateShaderParams(); 24 | } 25 | 26 | private void OnValidate() 27 | { 28 | FadeDistanceStart = Mathf.Max(FadeDistanceStart, 0); 29 | FadeDistanceEnd = Mathf.Max(FadeDistanceEnd, 0); 30 | FadeDistanceStart = Mathf.Max(FadeDistanceStart, FadeDistanceEnd); 31 | 32 | UpdateShaderParams(); 33 | } 34 | 35 | private void UpdateShaderParams() 36 | { 37 | float rangeInverse = 1.0f / (FadeDistanceStart - FadeDistanceEnd); 38 | var fadeDist = new Vector4(-FadeDistanceEnd * rangeInverse, rangeInverse, 0, 0); 39 | 40 | Shader.SetGlobalVector(fadeDistancePropertyID, fadeDist); 41 | 42 | if (NearPlaneFadeOn) 43 | { 44 | Shader.EnableKeyword(FadeKeywordOn); 45 | } 46 | else 47 | { 48 | Shader.DisableKeyword(FadeKeywordOn); 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/Singleton.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity 7 | { 8 | /// 9 | /// Singleton behaviour class, used for components that should only have one instance 10 | /// 11 | /// 12 | public class Singleton : MonoBehaviour where T : Singleton 13 | { 14 | private static T instance; 15 | public static T Instance 16 | { 17 | get 18 | { 19 | return instance; 20 | } 21 | } 22 | 23 | /// 24 | /// Returns whether the instance has been initialized or not. 25 | /// 26 | public static bool IsInitialized 27 | { 28 | get 29 | { 30 | return instance != null; 31 | } 32 | } 33 | 34 | /// 35 | /// Base awake method that sets the singleton's unique instance. 36 | /// 37 | protected virtual void Awake() 38 | { 39 | if (instance != null) 40 | { 41 | Debug.LogErrorFormat("Trying to instantiate a second instance of singleton class {0}", GetType().Name); 42 | } 43 | else 44 | { 45 | instance = (T) this; 46 | } 47 | } 48 | 49 | protected virtual void OnDestroy() 50 | { 51 | if (instance == this) 52 | { 53 | instance = null; 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/SphereBasedTagalong.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | 6 | namespace HoloToolkit.Unity 7 | { 8 | /// 9 | /// A Tagalong that stays at a fixed distance from the camera and always 10 | /// seeks to stay on the edge or inside a sphere that is straight in front of the camera. 11 | /// 12 | public class SphereBasedTagalong : MonoBehaviour 13 | { 14 | [Tooltip("Sphere radius.")] 15 | public float SphereRadius = 1.0f; 16 | 17 | [Tooltip("How fast the object will move to the target position.")] 18 | public float MoveSpeed = 2.0f; 19 | 20 | [Tooltip("When moving, use unscaled time. This is useful for games that have a pause mechanism or otherwise adjust the game timescale.")] 21 | public bool UseUnscaledTime = true; 22 | 23 | [Tooltip("Display the sphere in red wireframe for debugging purposes.")] 24 | public bool DebugDisplaySphere = false; 25 | 26 | [Tooltip("Display a small green cube where the target position is.")] 27 | public bool DebugDisplayTargetPosition = false; 28 | 29 | private Vector3 targetPosition; 30 | private Vector3 optimalPosition; 31 | private float initialDistanceToCamera; 32 | 33 | void Start() 34 | { 35 | initialDistanceToCamera = Vector3.Distance(this.transform.position, Camera.main.transform.position); 36 | } 37 | 38 | void Update() 39 | { 40 | optimalPosition = Camera.main.transform.position + Camera.main.transform.forward * initialDistanceToCamera; 41 | 42 | Vector3 offsetDir = this.transform.position - optimalPosition; 43 | if (offsetDir.magnitude > SphereRadius) 44 | { 45 | targetPosition = optimalPosition + offsetDir.normalized * SphereRadius; 46 | 47 | float deltaTime = UseUnscaledTime 48 | ? Time.unscaledDeltaTime 49 | : Time.deltaTime; 50 | 51 | this.transform.position = Vector3.Lerp(this.transform.position, targetPosition, MoveSpeed * deltaTime); 52 | } 53 | } 54 | 55 | public void OnDrawGizmos() 56 | { 57 | if (Application.isPlaying == false) return; 58 | 59 | Color oldColor = Gizmos.color; 60 | 61 | if (DebugDisplaySphere) 62 | { 63 | Gizmos.color = Color.red; 64 | Gizmos.DrawWireSphere(optimalPosition, SphereRadius); 65 | } 66 | 67 | if (DebugDisplayTargetPosition) 68 | { 69 | Gizmos.color = Color.green; 70 | Gizmos.DrawCube(targetPosition, new Vector3(0.1f, 0.1f, 0.1f)); 71 | } 72 | 73 | Gizmos.color = oldColor; 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Scripts/Timer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | namespace HoloToolkit.Unity 5 | { 6 | /// 7 | /// Structure that defines a timer. A timer can be scheduled through the TimerScheduler 8 | /// 9 | public struct Timer 10 | { 11 | public int Id; 12 | 13 | public static Timer Invalid = new Timer(0); 14 | 15 | public Timer(int id) 16 | { 17 | Id = id; 18 | } 19 | 20 | public bool IsActive 21 | { 22 | get 23 | { 24 | return (Id != Invalid.Id) && TimerScheduler.Instance.IsTimerActive(this); 25 | } 26 | } 27 | 28 | public static Timer Start(float timeSeconds, TimerScheduler.Callback callback, bool loop = false) 29 | { 30 | if (TimerScheduler.IsInitialized) 31 | { 32 | return TimerScheduler.Instance.StartTimer(timeSeconds, callback, loop); 33 | } 34 | 35 | return Timer.Invalid; 36 | } 37 | 38 | public static Timer StartNextFrame(TimerScheduler.Callback callback) 39 | { 40 | if (TimerScheduler.IsInitialized) 41 | { 42 | return TimerScheduler.Instance.StartTimer(0.0f, callback, false, true); 43 | } 44 | 45 | return Timer.Invalid; 46 | } 47 | 48 | public void Stop() 49 | { 50 | if (TimerScheduler.IsInitialized) 51 | { 52 | TimerScheduler.Instance.StopTimer(this); 53 | Id = Invalid.Id; 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/BlinnPhongConfigurable.cginc: -------------------------------------------------------------------------------- 1 | #if _USEMAINTEX_ON 2 | UNITY_DECLARE_TEX2D(_MainTex); 3 | #endif 4 | 5 | #if _USECOLOR_ON 6 | float4 _Color; 7 | #endif 8 | 9 | #if _USEBUMPMAP_ON 10 | UNITY_DECLARE_TEX2D(_BumpMap); 11 | #endif 12 | 13 | #if _USEEMISSIONTEX_ON 14 | UNITY_DECLARE_TEX2D(_EmissionTex); 15 | #endif 16 | 17 | float _Specular; 18 | float _Gloss; 19 | 20 | struct Input 21 | { 22 | // Will get compiled out if not touched 23 | float2 uv_MainTex; 24 | 25 | #if _NEAR_PLANE_FADE_ON 26 | float fade; 27 | #endif 28 | }; 29 | 30 | void vert(inout appdata_full v, out Input o) 31 | { 32 | UNITY_INITIALIZE_OUTPUT(Input, o); 33 | 34 | #if _NEAR_PLANE_FADE_ON 35 | o.fade = ComputeNearPlaneFadeLinear(v.vertex); 36 | #endif 37 | } 38 | 39 | void surf(Input IN, inout SurfaceOutput o) 40 | { 41 | float4 c; 42 | 43 | #if _USEMAINTEX_ON 44 | c = UNITY_SAMPLE_TEX2D(_MainTex, IN.uv_MainTex); 45 | #else 46 | c = 1; 47 | #endif 48 | 49 | #if _USECOLOR_ON 50 | c *= _Color; 51 | #endif 52 | 53 | o.Albedo = c.rgb; 54 | 55 | #if _NEAR_PLANE_FADE_ON 56 | o.Albedo.rgb *= IN.fade; 57 | #endif 58 | 59 | o.Alpha = c.a; 60 | o.Specular = _Specular; 61 | o.Gloss = _Gloss; 62 | 63 | #if _USEBUMPMAP_ON 64 | o.Normal = UnpackNormal(UNITY_SAMPLE_TEX2D(_BumpMap, IN.uv_MainTex)); 65 | #endif 66 | 67 | #if _USEEMISSIONTEX_ON 68 | o.Emission = UNITY_SAMPLE_TEX2D(_EmissionTex, IN.uv_MainTex); 69 | #endif 70 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/BlinnPhongConfigurable.shader: -------------------------------------------------------------------------------- 1 | // Very fast shader that uses the Unity lighting model. 2 | // Compiles down to only performing the operations you're actually using. 3 | // Uses material property drawers rather than a custom editor for ease of maintenance. 4 | 5 | Shader "HoloToolkit/BlinnPhong Configurable" 6 | { 7 | Properties 8 | { 9 | [Header(Main Color)] 10 | [Toggle] _UseColor("Enabled?", Float) = 0 11 | _Color("Main Color", Color) = (1,1,1,1) 12 | [Space(20)] 13 | 14 | [Header(Base(RGB))] 15 | [Toggle] _UseMainTex("Enabled?", Float) = 1 16 | _MainTex("Base (RGB)", 2D) = "white" {} 17 | [Space(20)] 18 | 19 | // Uses UV scale, etc from main texture 20 | [Header(Normalmap)] 21 | [Toggle] _UseBumpMap("Enabled?", Float) = 0 22 | [NoScaleOffset] _BumpMap("Normalmap", 2D) = "bump" {} 23 | [Space(20)] 24 | 25 | // Uses UV scale, etc from main texture 26 | [Header(Emission(RGB))] 27 | [Toggle] _UseEmissionTex("Enabled?", Float) = 0 28 | [NoScaleOffset] _EmissionTex("Emission (RGB)", 2D) = "white" {} 29 | [Space(20)] 30 | 31 | // Specular 32 | [Header(Specular)] 33 | _SpecColor("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 34 | _Specular("Specular", Range(0.0, 1.0)) = 0.5 35 | _Gloss("Gloss", Range(0.0, 10.0)) = 0.5 36 | [Space(20)] 37 | 38 | [Header(Blend State)] 39 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" 40 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" 41 | [Space(20)] 42 | 43 | [Header(Other)] 44 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" 45 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" 46 | [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" 47 | [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" 48 | } 49 | 50 | SubShader 51 | { 52 | Tags { "RenderType" = "Opaque" "PerformanceChecks" = "False" } 53 | Blend[_SrcBlend][_DstBlend] 54 | ZTest[_ZTest] 55 | ZWrite[_ZWrite] 56 | Cull[_Cull] 57 | ColorMask[_ColorWriteMask] 58 | LOD 300 59 | 60 | CGPROGRAM 61 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 62 | #pragma target 5.0 63 | #pragma only_renderers d3d11 64 | 65 | #pragma surface surf BlinnPhong vertex:vert 66 | 67 | #pragma shader_feature _USECOLOR_ON 68 | #pragma shader_feature _USEMAINTEX_ON 69 | #pragma shader_feature _USEBUMPMAP_ON 70 | #pragma shader_feature _USEEMISSIONTEX_ON 71 | #pragma multi_compile __ _NEAR_PLANE_FADE_ON 72 | 73 | #include "HoloToolkitCommon.cginc" 74 | #include "BlinnPhongConfigurable.cginc" 75 | 76 | ENDCG 77 | } 78 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/BlinnPhongConfigurableTransparent.shader: -------------------------------------------------------------------------------- 1 | // Very fast shader that uses the Unity lighting model. 2 | // Compiles down to only performing the operations you're actually using. 3 | // Uses material property drawers rather than a custom editor for ease of maintenance. 4 | 5 | Shader "HoloToolkit/BlinnPhong Configurable Transparent" 6 | { 7 | Properties 8 | { 9 | [Header(Main Color)] 10 | [Toggle] _UseColor("Enabled?", Float) = 0 11 | _Color("Main Color", Color) = (1,1,1,1) 12 | [Space(20)] 13 | 14 | [Header(Base(RGB))] 15 | [Toggle] _UseMainTex("Enabled?", Float) = 1 16 | _MainTex("Base (RGB)", 2D) = "white" {} 17 | [Space(20)] 18 | 19 | // Uses UV scale, etc from main texture 20 | [Header(Normalmap)] 21 | [Toggle] _UseBumpMap("Enabled?", Float) = 0 22 | [NoScaleOffset] _BumpMap("Normalmap", 2D) = "bump" {} 23 | [Space(20)] 24 | 25 | // Uses UV scale, etc from main texture 26 | [Header(Emission(RGB))] 27 | [Toggle] _UseEmissionTex("Enabled?", Float) = 0 28 | [NoScaleOffset] _EmissionTex("Emission (RGB)", 2D) = "white" {} 29 | [Space(20)] 30 | 31 | // Specular 32 | [Header(Specular)] 33 | _SpecColor("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 34 | _Specular("Specular", Range(0.0, 1.0)) = 0.5 35 | _Gloss("Gloss", Range(0.0, 10.0)) = 0.5 36 | [Space(20)] 37 | 38 | [Header(Blend State)] 39 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" 40 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" 41 | [Space(20)] 42 | 43 | [Header(Other)] 44 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" 45 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" 46 | [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" 47 | [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" 48 | } 49 | 50 | SubShader 51 | { 52 | Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "PerformanceChecks" = "False" } 53 | Blend[_SrcBlend][_DstBlend] 54 | ZTest[_ZTest] 55 | ZWrite[_ZWrite] 56 | Cull[_Cull] 57 | ColorMask[_ColorWriteMask] 58 | LOD 300 59 | 60 | CGPROGRAM 61 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 62 | #pragma target 5.0 63 | #pragma only_renderers d3d11 64 | 65 | #pragma surface surf BlinnPhong vertex:vert alpha:fade 66 | 67 | #pragma shader_feature _USECOLOR_ON 68 | #pragma shader_feature _USEMAINTEX_ON 69 | #pragma shader_feature _USEBUMPMAP_ON 70 | #pragma shader_feature _USEEMISSIONTEX_ON 71 | #pragma multi_compile __ _NEAR_PLANE_FADE_ON 72 | 73 | #include "HoloToolkitCommon.cginc" 74 | #include "BlinnPhongConfigurable.cginc" 75 | 76 | ENDCG 77 | } 78 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/HoloToolkitCommon.cginc: -------------------------------------------------------------------------------- 1 | #ifndef HOLOTOOLKIT_COMMON 2 | #define HOLOTOOLKIT_COMMON 3 | 4 | // Helper function for focal plane fading 5 | float4 _NearPlaneFadeDistance; 6 | 7 | float ComputeNearPlaneFadeLinear(float4 vertex) 8 | { 9 | float distToCamera = -(mul(UNITY_MATRIX_MV, vertex).z); 10 | return saturate(mad(distToCamera, _NearPlaneFadeDistance.y, _NearPlaneFadeDistance.x)); 11 | } 12 | 13 | #endif //HOLOTOOLKIT_COMMON -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/LambertianConfigurable.cginc: -------------------------------------------------------------------------------- 1 | #if _USEMAINTEX_ON 2 | UNITY_DECLARE_TEX2D(_MainTex); 3 | #endif 4 | 5 | #if _USECOLOR_ON 6 | float4 _Color; 7 | #endif 8 | 9 | #if _USEBUMPMAP_ON 10 | UNITY_DECLARE_TEX2D(_BumpMap); 11 | #endif 12 | 13 | #if _USEEMISSIONTEX_ON 14 | UNITY_DECLARE_TEX2D(_EmissionTex); 15 | #endif 16 | 17 | struct Input 18 | { 19 | // Will get compiled out if not touched 20 | float2 uv_MainTex; 21 | 22 | #if _NEAR_PLANE_FADE_ON 23 | float fade; 24 | #endif 25 | }; 26 | 27 | void vert(inout appdata_full v, out Input o) 28 | { 29 | UNITY_INITIALIZE_OUTPUT(Input, o); 30 | 31 | #if _NEAR_PLANE_FADE_ON 32 | o.fade = ComputeNearPlaneFadeLinear(v.vertex); 33 | #endif 34 | } 35 | 36 | void surf(Input IN, inout SurfaceOutput o) 37 | { 38 | float4 c; 39 | 40 | #if _USEMAINTEX_ON 41 | c = UNITY_SAMPLE_TEX2D(_MainTex, IN.uv_MainTex); 42 | #else 43 | c = 1; 44 | #endif 45 | 46 | #if _USECOLOR_ON 47 | c *= _Color; 48 | #endif 49 | 50 | o.Albedo = c.rgb; 51 | 52 | #if _NEAR_PLANE_FADE_ON 53 | o.Albedo.rgb *= IN.fade; 54 | #endif 55 | 56 | o.Alpha = c.a; 57 | 58 | #if _USEBUMPMAP_ON 59 | o.Normal = UnpackNormal(UNITY_SAMPLE_TEX2D(_BumpMap, IN.uv_MainTex)); 60 | #endif 61 | 62 | #if _USEEMISSIONTEX_ON 63 | o.Emission = UNITY_SAMPLE_TEX2D(_EmissionTex, IN.uv_MainTex); 64 | #endif 65 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/LambertianConfigurable.shader: -------------------------------------------------------------------------------- 1 | // Very fast shader that uses the Unity lighting model. 2 | // Compiles down to only performing the operations you're actually using. 3 | // Uses material property drawers rather than a custom editor for ease of maintenance. 4 | 5 | Shader "HoloToolkit/Lambertian Configurable" 6 | { 7 | Properties 8 | { 9 | [Header(Main Color)] 10 | [Toggle] _UseColor("Enabled?", Float) = 0 11 | _Color("Main Color", Color) = (1,1,1,1) 12 | [Space(20)] 13 | 14 | [Header(Base(RGB))] 15 | [Toggle] _UseMainTex("Enabled?", Float) = 1 16 | _MainTex("Base (RGB)", 2D) = "white" {} 17 | [Space(20)] 18 | 19 | // Uses UV scale, etc from main texture 20 | [Header(Normalmap)] 21 | [Toggle] _UseBumpMap("Enabled?", Float) = 0 22 | [NoScaleOffset] _BumpMap("Normalmap", 2D) = "bump" {} 23 | [Space(20)] 24 | 25 | // Uses UV scale, etc from main texture 26 | [Header(Emission(RGB))] 27 | [Toggle] _UseEmissionTex("Enabled?", Float) = 0 28 | [NoScaleOffset] _EmissionTex("Emission (RGB)", 2D) = "white" {} 29 | [Space(20)] 30 | 31 | [Header(Blend State)] 32 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" 33 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" 34 | [Space(20)] 35 | 36 | [Header(Other)] 37 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" 38 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" 39 | [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" 40 | [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" 41 | } 42 | 43 | SubShader 44 | { 45 | Tags { "RenderType" = "Opaque" "PerformanceChecks" = "False" } 46 | Blend[_SrcBlend][_DstBlend] 47 | ZTest[_ZTest] 48 | ZWrite[_ZWrite] 49 | Cull[_Cull] 50 | ColorMask[_ColorWriteMask] 51 | LOD 300 52 | 53 | CGPROGRAM 54 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 55 | #pragma target 5.0 56 | #pragma only_renderers d3d11 57 | 58 | #pragma surface surf Lambert vertex:vert 59 | 60 | #pragma shader_feature _USECOLOR_ON 61 | #pragma shader_feature _USEMAINTEX_ON 62 | #pragma shader_feature _USEBUMPMAP_ON 63 | #pragma shader_feature _USEEMISSIONTEX_ON 64 | #pragma multi_compile __ _NEAR_PLANE_FADE_ON 65 | 66 | #include "HoloToolkitCommon.cginc" 67 | #include "LambertianConfigurable.cginc" 68 | 69 | ENDCG 70 | } 71 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/LambertianConfigurableTransparent.shader: -------------------------------------------------------------------------------- 1 | // Very fast shader that uses the Unity lighting model. 2 | // Compiles down to only performing the operations you're actually using. 3 | // Uses material property drawers rather than a custom editor for ease of maintenance. 4 | 5 | Shader "HoloToolkit/Lambertian Configurable Transparent" 6 | { 7 | Properties 8 | { 9 | [Header(Main Color)] 10 | [Toggle] _UseColor("Enabled?", Float) = 0 11 | _Color("Main Color", Color) = (1,1,1,1) 12 | [Space(20)] 13 | 14 | [Header(Base(RGB))] 15 | [Toggle] _UseMainTex("Enabled?", Float) = 1 16 | _MainTex("Base (RGB)", 2D) = "white" {} 17 | [Space(20)] 18 | 19 | // Uses UV scale, etc from main texture 20 | [Header(Normalmap)] 21 | [Toggle] _UseBumpMap("Enabled?", Float) = 0 22 | [NoScaleOffset] _BumpMap("Normalmap", 2D) = "bump" {} 23 | [Space(20)] 24 | 25 | // Uses UV scale, etc from main texture 26 | [Header(Emission(RGB))] 27 | [Toggle] _UseEmissionTex("Enabled?", Float) = 0 28 | [NoScaleOffset] _EmissionTex("Emission (RGB)", 2D) = "white" {} 29 | [Space(20)] 30 | 31 | [Header(Blend State)] 32 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" 33 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" 34 | [Space(20)] 35 | 36 | [Header(Other)] 37 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" 38 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" 39 | [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" 40 | [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" 41 | } 42 | 43 | SubShader 44 | { 45 | Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "PerformanceChecks" = "False" } 46 | Blend[_SrcBlend][_DstBlend] 47 | ZTest[_ZTest] 48 | ZWrite[_ZWrite] 49 | Cull[_Cull] 50 | ColorMask[_ColorWriteMask] 51 | LOD 300 52 | 53 | CGPROGRAM 54 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 55 | #pragma target 5.0 56 | #pragma only_renderers d3d11 57 | 58 | #pragma surface surf Lambert vertex:vert alpha:fade 59 | 60 | #pragma shader_feature _USECOLOR_ON 61 | #pragma shader_feature _USEMAINTEX_ON 62 | #pragma shader_feature _USEBUMPMAP_ON 63 | #pragma shader_feature _USEEMISSIONTEX_ON 64 | #pragma multi_compile __ _NEAR_PLANE_FADE_ON 65 | 66 | #include "HoloToolkitCommon.cginc" 67 | #include "LambertianConfigurable.cginc" 68 | 69 | ENDCG 70 | } 71 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/UnlitConfigurable.cginc: -------------------------------------------------------------------------------- 1 | #include "UnityCG.cginc" 2 | 3 | #if _USEMAINTEX_ON 4 | UNITY_DECLARE_TEX2D(_MainTex); 5 | float4 _MainTex_ST; 6 | #endif 7 | 8 | #if _USECOLOR_ON 9 | float4 _Color; 10 | #endif 11 | 12 | struct appdata_t 13 | { 14 | float4 vertex : POSITION; 15 | #if _USEMAINTEX_ON 16 | float2 texcoord : TEXCOORD0; 17 | #endif 18 | UNITY_VERTEX_INPUT_INSTANCE_ID 19 | }; 20 | 21 | struct v2f 22 | { 23 | float4 vertex : SV_POSITION; 24 | #if _USEMAINTEX_ON 25 | float2 texcoord : TEXCOORD0; 26 | #endif 27 | UNITY_FOG_COORDS(1) 28 | #if _NEAR_PLANE_FADE_ON 29 | float fade : TEXCOORD2; 30 | #endif 31 | UNITY_VERTEX_OUTPUT_STEREO 32 | }; 33 | 34 | v2f vert(appdata_t v) 35 | { 36 | UNITY_SETUP_INSTANCE_ID(v); 37 | v2f o; 38 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 39 | 40 | #if _USEMAINTEX_ON 41 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 42 | #endif 43 | 44 | #if _NEAR_PLANE_FADE_ON 45 | o.fade = ComputeNearPlaneFadeLinear(v.vertex); 46 | #endif 47 | 48 | UNITY_TRANSFER_FOG(o, o.vertex); 49 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 50 | return o; 51 | } 52 | 53 | float4 frag(v2f i) : SV_Target 54 | { 55 | float4 c; 56 | 57 | #if _USEMAINTEX_ON 58 | c = UNITY_SAMPLE_TEX2D(_MainTex, i.texcoord); 59 | #else 60 | c = 1; 61 | #endif 62 | 63 | #if _USECOLOR_ON 64 | c *= _Color; 65 | #endif 66 | 67 | UNITY_APPLY_FOG(i.fogCoord, c); 68 | 69 | #if _NEAR_PLANE_FADE_ON 70 | c.rgb *= i.fade; 71 | #endif 72 | 73 | return c; 74 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/UnlitConfigurable.shader: -------------------------------------------------------------------------------- 1 | // Very fast unlit shader. 2 | // No lighting, lightmap support, etc. 3 | // Compiles down to only performing the operations you're actually using. 4 | // Uses material property drawers rather than a custom editor for ease of maintenance. 5 | 6 | Shader "HoloToolkit/Unlit Configurable" 7 | { 8 | Properties 9 | { 10 | [Header(Main Color)] 11 | [Toggle] _UseColor("Enabled?", Float) = 0 12 | _Color("Main Color", Color) = (1,1,1,1) 13 | [Space(20)] 14 | 15 | [Header(Base(RGB))] 16 | [Toggle] _UseMainTex("Enabled?", Float) = 1 17 | _MainTex("Base (RGB)", 2D) = "white" {} 18 | [Space(20)] 19 | 20 | [Header(Blend State)] 21 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" 22 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" 23 | [Space(20)] 24 | 25 | [Header(Other)] 26 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" 27 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" 28 | [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" 29 | [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" 30 | } 31 | 32 | SubShader 33 | { 34 | Tags { "RenderType" = "Opaque" } 35 | LOD 100 36 | Blend[_SrcBlend][_DstBlend] 37 | ZTest[_ZTest] 38 | ZWrite[_ZWrite] 39 | Cull[_Cull] 40 | ColorMask[_ColorWriteMask] 41 | 42 | Pass 43 | { 44 | Name "FORWARD" 45 | Tags { "LightMode" = "Always" } 46 | 47 | CGPROGRAM 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | #pragma multi_compile_fog 51 | 52 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 53 | #pragma target 5.0 54 | #pragma only_renderers d3d11 55 | 56 | #pragma shader_feature _USECOLOR_ON 57 | #pragma shader_feature _USEMAINTEX_ON 58 | #pragma multi_compile __ _NEAR_PLANE_FADE_ON 59 | 60 | #include "HoloToolkitCommon.cginc" 61 | #include "UnlitConfigurable.cginc" 62 | 63 | ENDCG 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/UnlitConfigurableTransparent.shader: -------------------------------------------------------------------------------- 1 | // Very fast unlit shader. 2 | // No lighting, lightmap support, etc. 3 | // Compiles down to only performing the operations you're actually using. 4 | // Uses material property drawers rather than a custom editor for ease of maintenance. 5 | 6 | Shader "HoloToolkit/Unlit Configurable Transparent" 7 | { 8 | Properties 9 | { 10 | [Header(Main Color)] 11 | [Toggle] _UseColor("Enabled?", Float) = 0 12 | _Color("Main Color", Color) = (1,1,1,1) 13 | [Space(20)] 14 | 15 | [Header(Base(RGB))] 16 | [Toggle] _UseMainTex("Enabled?", Float) = 1 17 | _MainTex("Base (RGB)", 2D) = "white" {} 18 | [Space(20)] 19 | 20 | [Header(Blend State)] 21 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" 22 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" 23 | [Space(20)] 24 | 25 | [Header(Other)] 26 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" 27 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" 28 | [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" 29 | [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" 30 | } 31 | 32 | SubShader 33 | { 34 | Tags { "RenderType" = "Transparent" "Queue" = "Transparent" } 35 | LOD 100 36 | Blend[_SrcBlend][_DstBlend] 37 | ZTest[_ZTest] 38 | ZWrite[_ZWrite] 39 | Cull[_Cull] 40 | ColorMask[_ColorWriteMask] 41 | 42 | Pass 43 | { 44 | Name "FORWARD" 45 | Tags { "LightMode" = "Always" } 46 | 47 | CGPROGRAM 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | #pragma multi_compile_fog 51 | 52 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 53 | #pragma target 5.0 54 | #pragma only_renderers d3d11 55 | 56 | #pragma shader_feature _USECOLOR_ON 57 | #pragma shader_feature _USEMAINTEX_ON 58 | #pragma multi_compile __ _NEAR_PLANE_FADE_ON 59 | 60 | #include "HoloToolkitCommon.cginc" 61 | #include "UnlitConfigurable.cginc" 62 | 63 | ENDCG 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/UnlitNoDepthTest.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/NoDepth" 2 | { 3 | Properties 4 | { 5 | _MainTex("Texture", 2D) = "white" {} 6 | } 7 | SubShader 8 | { 9 | Tags { "Queue" = "Transparent" } 10 | LOD 100 11 | 12 | Pass 13 | { 14 | ZTest Always 15 | Blend SrcAlpha OneMinusSrcAlpha 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | 20 | #include "UnityCG.cginc" 21 | 22 | struct appdata 23 | { 24 | float4 vertex : POSITION; 25 | float2 uv : TEXCOORD0; 26 | UNITY_VERTEX_INPUT_INSTANCE_ID 27 | }; 28 | 29 | struct v2f 30 | { 31 | float2 uv : TEXCOORD0; 32 | float4 vertex : SV_POSITION; 33 | UNITY_VERTEX_OUTPUT_STEREO 34 | }; 35 | 36 | sampler2D _MainTex; 37 | float4 _MainTex_ST; 38 | 39 | v2f vert(appdata v) 40 | { 41 | UNITY_SETUP_INSTANCE_ID(v); 42 | v2f o; 43 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 44 | o.uv = v.uv; 45 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 46 | return o; 47 | } 48 | 49 | fixed4 frag(v2f i) : SV_Target 50 | { 51 | // sample the texture 52 | fixed4 col = tex2D(_MainTex, i.uv); 53 | return col; 54 | } 55 | ENDCG 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/VertexLitConfigurable.shader: -------------------------------------------------------------------------------- 1 | // Very fast vertex lit shader that uses the Unity lighting model. 2 | // Compiles down to only performing the operations you're actually using. 3 | // Uses material property drawers rather than a custom editor for ease of maintenance. 4 | 5 | Shader "HoloToolkit/Vertex Lit Configurable" 6 | { 7 | Properties 8 | { 9 | [Header(Main Color)] 10 | [Toggle] _UseColor("Enabled?", Float) = 0 11 | _Color("Main Color", Color) = (1,1,1,1) 12 | [Space(20)] 13 | 14 | [Header(Base(RGB))] 15 | [Toggle] _UseMainTex("Enabled?", Float) = 1 16 | _MainTex("Base (RGB)", 2D) = "white" {} 17 | [Space(20)] 18 | 19 | // Uses UV scale, etc from main texture 20 | [Header(Emission(RGB))] 21 | [Toggle] _UseEmissionTex("Enabled?", Float) = 0 22 | [NoScaleOffset] _EmissionTex("Emission (RGB)", 2D) = "white" {} 23 | [Space(20)] 24 | 25 | [Header(Blend State)] 26 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" 27 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" 28 | [Space(20)] 29 | 30 | [Header(Other)] 31 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" 32 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" 33 | [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" 34 | [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" 35 | } 36 | 37 | SubShader 38 | { 39 | Tags { "RenderType" = "Opaque" "PerformanceChecks" = "False" } 40 | LOD 100 41 | Blend[_SrcBlend][_DstBlend] 42 | ZTest[_ZTest] 43 | ZWrite[_ZWrite] 44 | Cull[_Cull] 45 | ColorMask[_ColorWriteMask] 46 | 47 | Pass 48 | { 49 | Name "FORWARD" 50 | Tags { "LightMode" = "ForwardBase" } 51 | 52 | CGPROGRAM 53 | #pragma vertex vert 54 | #pragma fragment frag 55 | 56 | #pragma multi_compile_fwdbase 57 | #pragma multi_compile_fog 58 | 59 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 60 | #pragma target 5.0 61 | #pragma only_renderers d3d11 62 | 63 | #pragma shader_feature _USECOLOR_ON 64 | #pragma shader_feature _USEMAINTEX_ON 65 | #pragma shader_feature _USEEMISSIONTEX_ON 66 | #pragma multi_compile __ _NEAR_PLANE_FADE_ON 67 | 68 | #include "HoloToolkitCommon.cginc" 69 | #include "VertexLitConfigurable.cginc" 70 | 71 | ENDCG 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/VertexLitConfigurableTransparent.shader: -------------------------------------------------------------------------------- 1 | // Very fast vertex lit shader that uses the Unity lighting model. 2 | // Compiles down to only performing the operations you're actually using. 3 | // Uses material property drawers rather than a custom editor for ease of maintenance. 4 | 5 | Shader "HoloToolkit/Vertex Lit Configurable Transparent" 6 | { 7 | Properties 8 | { 9 | [Header(Main Color)] 10 | [Toggle] _UseColor("Enabled?", Float) = 0 11 | _Color("Main Color", Color) = (1,1,1,1) 12 | [Space(20)] 13 | 14 | [Header(Base(RGB))] 15 | [Toggle] _UseMainTex("Enabled?", Float) = 1 16 | _MainTex("Base (RGB)", 2D) = "white" {} 17 | [Space(20)] 18 | 19 | // Uses UV scale, etc from main texture 20 | [Header(Emission(RGB))] 21 | [Toggle] _UseEmissionTex("Enabled?", Float) = 0 22 | [NoScaleOffset] _EmissionTex("Emission (RGB)", 2D) = "white" {} 23 | [Space(20)] 24 | 25 | [Header(Blend State)] 26 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("SrcBlend", Float) = 1 //"One" 27 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("DestBlend", Float) = 0 //"Zero" 28 | [Space(20)] 29 | 30 | [Header(Other)] 31 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2 //"Back" 32 | [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4 //"LessEqual" 33 | [Enum(Off,0,On,1)] _ZWrite("ZWrite", Float) = 1.0 //"On" 34 | [Enum(UnityEngine.Rendering.ColorWriteMask)] _ColorWriteMask("ColorWriteMask", Float) = 15 //"All" 35 | } 36 | 37 | SubShader 38 | { 39 | Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "PerformanceChecks" = "False" } 40 | LOD 100 41 | Blend[_SrcBlend][_DstBlend] 42 | ZTest[_ZTest] 43 | ZWrite[_ZWrite] 44 | Cull[_Cull] 45 | ColorMask[_ColorWriteMask] 46 | 47 | Pass 48 | { 49 | Name "FORWARD" 50 | Tags{ "LightMode" = "ForwardBase" } 51 | 52 | CGPROGRAM 53 | #pragma vertex vert 54 | #pragma fragment frag 55 | 56 | #pragma multi_compile_fwdbase 57 | #pragma multi_compile_fog 58 | 59 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 60 | #pragma target 5.0 61 | #pragma only_renderers d3d11 62 | 63 | #pragma shader_feature _USECOLOR_ON 64 | #pragma shader_feature _USEMAINTEX_ON 65 | #pragma shader_feature _USEEMISSIONTEX_ON 66 | #pragma multi_compile __ _NEAR_PLANE_FADE_ON 67 | 68 | #include "HoloToolkitCommon.cginc" 69 | #include "VertexLitConfigurable.cginc" 70 | 71 | ENDCG 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Shaders/WindowOcclusion.shader: -------------------------------------------------------------------------------- 1 | /// 2 | /// Simple occlusion shader that can be used to hide other objects. 3 | /// This prevents other objects from being rendered by drawing invisible 'opaque' pixels to the depth buffer. 4 | /// 5 | Shader "HoloToolkit/WindowOcclusion" 6 | { 7 | Properties 8 | { 9 | } 10 | SubShader 11 | { 12 | Tags 13 | { 14 | "RenderType" = "Opaque" 15 | "Queue" = "Geometry-1" 16 | } 17 | 18 | Pass 19 | { 20 | ColorMask 0 // Color will not be rendered. 21 | 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | 26 | // We only target the HoloLens (and the Unity editor), so take advantage of shader model 5. 27 | #pragma target 5.0 28 | #pragma only_renderers d3d11 29 | 30 | #include "UnityCG.cginc" 31 | 32 | struct v2f 33 | { 34 | float4 pos : SV_POSITION; 35 | UNITY_VERTEX_OUTPUT_STEREO 36 | }; 37 | 38 | v2f vert(appdata_base v) 39 | { 40 | UNITY_SETUP_INSTANCE_ID(v); 41 | v2f o; 42 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 43 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 44 | return o; 45 | } 46 | 47 | half4 frag(v2f i) : COLOR 48 | { 49 | return float4(1,1,1,1); 50 | } 51 | ENDCG 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Animations/PopupText.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: PopupText 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 110707640} 15 | m_Mask: {fileID: 0} 16 | m_Motions: [] 17 | m_Behaviours: [] 18 | m_BlendingMode: 0 19 | m_SyncedLayerIndex: -1 20 | m_DefaultWeight: 0 21 | m_IKPass: 0 22 | m_SyncedLayerAffectsTiming: 0 23 | m_Controller: {fileID: 9100000} 24 | --- !u!1102 &110272260 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: textfade 31 | m_Speed: 1 32 | m_CycleOffset: 0 33 | m_Transitions: [] 34 | m_StateMachineBehaviours: [] 35 | m_Position: {x: 50, y: 50, z: 0} 36 | m_IKOnFeet: 0 37 | m_WriteDefaultValues: 1 38 | m_Mirror: 0 39 | m_SpeedParameterActive: 0 40 | m_MirrorParameterActive: 0 41 | m_CycleOffsetParameterActive: 0 42 | m_Motion: {fileID: 7400000, guid: 3390915b31e5a9f4f8fd8e4789b20beb, type: 2} 43 | m_Tag: 44 | m_SpeedParameter: 45 | m_MirrorParameter: 46 | m_CycleOffsetParameter: 47 | --- !u!1107 &110707640 48 | AnimatorStateMachine: 49 | serializedVersion: 5 50 | m_ObjectHideFlags: 1 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 0} 53 | m_Name: Base Layer 54 | m_ChildStates: 55 | - serializedVersion: 1 56 | m_State: {fileID: 110272260} 57 | m_Position: {x: 240, y: 120, z: 0} 58 | m_ChildStateMachines: [] 59 | m_AnyStateTransitions: [] 60 | m_EntryTransitions: [] 61 | m_StateMachineTransitions: {} 62 | m_StateMachineBehaviours: [] 63 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 64 | m_EntryPosition: {x: 50, y: 120, z: 0} 65 | m_ExitPosition: {x: 800, y: 120, z: 0} 66 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 67 | m_DefaultState: {fileID: 110272260} 68 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Animations/horizontal.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: horizontal 9 | serializedVersion: 6 10 | m_Legacy: 1 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_EulerCurves: [] 16 | m_PositionCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - time: 0 21 | value: {x: -1.5, y: 0, z: 0} 22 | inSlope: {x: 0, y: 0, z: 0} 23 | outSlope: {x: 0, y: 0, z: 0} 24 | tangentMode: 0 25 | - time: 0.5 26 | value: {x: 1.5, y: 0, z: 0} 27 | inSlope: {x: 0, y: 0, z: 0} 28 | outSlope: {x: 0, y: 0, z: 0} 29 | tangentMode: 0 30 | - time: 1 31 | value: {x: -1.5, y: 0, z: 0} 32 | inSlope: {x: -0.06848287, y: 0, z: 0} 33 | outSlope: {x: -0.06848287, y: 0, z: 0} 34 | tangentMode: 0 35 | m_PreInfinity: 2 36 | m_PostInfinity: 2 37 | m_RotationOrder: 4 38 | path: 39 | m_ScaleCurves: [] 40 | m_FloatCurves: [] 41 | m_PPtrCurves: [] 42 | m_SampleRate: 10 43 | m_WrapMode: 2 44 | m_Bounds: 45 | m_Center: {x: 0, y: 0, z: 0} 46 | m_Extent: {x: 0, y: 0, z: 0} 47 | m_ClipBindingConstant: 48 | genericBindings: [] 49 | pptrCurveMapping: [] 50 | m_AnimationClipSettings: 51 | serializedVersion: 2 52 | m_AdditiveReferencePoseClip: {fileID: 0} 53 | m_AdditiveReferencePoseTime: 0 54 | m_StartTime: 0 55 | m_StopTime: 1 56 | m_OrientationOffsetY: 0 57 | m_Level: 0 58 | m_CycleOffset: 0 59 | m_HasAdditiveReferencePose: 0 60 | m_LoopTime: 1 61 | m_LoopBlend: 0 62 | m_LoopBlendOrientation: 0 63 | m_LoopBlendPositionY: 0 64 | m_LoopBlendPositionXZ: 0 65 | m_KeepOriginalOrientation: 0 66 | m_KeepOriginalPositionY: 1 67 | m_KeepOriginalPositionXZ: 0 68 | m_HeightFromFeet: 0 69 | m_Mirror: 0 70 | m_EditorCurves: 71 | - curve: 72 | serializedVersion: 2 73 | m_Curve: 74 | - time: 0 75 | value: -1.5 76 | inSlope: 0 77 | outSlope: 0 78 | tangentMode: 0 79 | - time: 0.5 80 | value: 1.5 81 | inSlope: 0 82 | outSlope: 0 83 | tangentMode: 10 84 | - time: 1 85 | value: -1.5 86 | inSlope: -0.06848287 87 | outSlope: -0.06848287 88 | tangentMode: 0 89 | m_PreInfinity: 2 90 | m_PostInfinity: 2 91 | m_RotationOrder: 4 92 | attribute: m_LocalPosition.x 93 | path: 94 | classID: 4 95 | script: {fileID: 0} 96 | m_EulerEditorCurves: [] 97 | m_HasGenericRootTransform: 0 98 | m_HasMotionFloatCurves: 0 99 | m_GenerateMotionCurves: 0 100 | m_Events: [] 101 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Animations/horizontal.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: horizontal 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 110780206} 15 | m_Mask: {fileID: 0} 16 | m_Motions: [] 17 | m_Behaviours: [] 18 | m_BlendingMode: 0 19 | m_SyncedLayerIndex: -1 20 | m_DefaultWeight: 0 21 | m_IKPass: 0 22 | m_SyncedLayerAffectsTiming: 0 23 | m_Controller: {fileID: 9100000} 24 | --- !u!1102 &110292912 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: spiral 31 | m_Speed: 1 32 | m_CycleOffset: 0 33 | m_Transitions: [] 34 | m_StateMachineBehaviours: [] 35 | m_Position: {x: 50, y: 50, z: 0} 36 | m_IKOnFeet: 0 37 | m_WriteDefaultValues: 1 38 | m_Mirror: 0 39 | m_SpeedParameterActive: 0 40 | m_MirrorParameterActive: 0 41 | m_CycleOffsetParameterActive: 0 42 | m_Motion: {fileID: 7400000, guid: 67a8ce2f5e4bfc74d9b3d3afad52cfae, type: 2} 43 | m_Tag: 44 | m_SpeedParameter: 45 | m_MirrorParameter: 46 | m_CycleOffsetParameter: 47 | --- !u!1107 &110780206 48 | AnimatorStateMachine: 49 | serializedVersion: 5 50 | m_ObjectHideFlags: 1 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 0} 53 | m_Name: Base Layer 54 | m_ChildStates: 55 | - serializedVersion: 1 56 | m_State: {fileID: 110292912} 57 | m_Position: {x: 200, y: 0, z: 0} 58 | m_ChildStateMachines: [] 59 | m_AnyStateTransitions: [] 60 | m_EntryTransitions: [] 61 | m_StateMachineTransitions: {} 62 | m_StateMachineBehaviours: [] 63 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 64 | m_EntryPosition: {x: 50, y: 120, z: 0} 65 | m_ExitPosition: {x: 800, y: 120, z: 0} 66 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 67 | m_DefaultState: {fileID: 110292912} 68 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Animations/spiral.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: spiral 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 110765876} 15 | m_Mask: {fileID: 0} 16 | m_Motions: [] 17 | m_Behaviours: [] 18 | m_BlendingMode: 0 19 | m_SyncedLayerIndex: -1 20 | m_DefaultWeight: 0 21 | m_IKPass: 0 22 | m_SyncedLayerAffectsTiming: 0 23 | m_Controller: {fileID: 9100000} 24 | --- !u!1102 &110233890 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: yz_circle 31 | m_Speed: 1 32 | m_CycleOffset: 0 33 | m_Transitions: [] 34 | m_StateMachineBehaviours: [] 35 | m_Position: {x: 50, y: 50, z: 0} 36 | m_IKOnFeet: 0 37 | m_WriteDefaultValues: 1 38 | m_Mirror: 0 39 | m_SpeedParameterActive: 0 40 | m_MirrorParameterActive: 0 41 | m_CycleOffsetParameterActive: 0 42 | m_Motion: {fileID: 7400000, guid: 5da9ff7336578ac4c92d101105bd17a7, type: 2} 43 | m_Tag: 44 | m_SpeedParameter: 45 | m_MirrorParameter: 46 | m_CycleOffsetParameter: 47 | --- !u!1107 &110765876 48 | AnimatorStateMachine: 49 | serializedVersion: 5 50 | m_ObjectHideFlags: 1 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 0} 53 | m_Name: Base Layer 54 | m_ChildStates: 55 | - serializedVersion: 1 56 | m_State: {fileID: 110233890} 57 | m_Position: {x: 200, y: 0, z: 0} 58 | m_ChildStateMachines: [] 59 | m_AnyStateTransitions: [] 60 | m_EntryTransitions: [] 61 | m_StateMachineTransitions: {} 62 | m_StateMachineBehaviours: [] 63 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 64 | m_EntryPosition: {x: 50, y: 120, z: 0} 65 | m_ExitPosition: {x: 800, y: 120, z: 0} 66 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 67 | m_DefaultState: {fileID: 110233890} 68 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Animations/textfade.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: textfade 9 | serializedVersion: 6 10 | m_Legacy: 0 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_EulerCurves: [] 16 | m_PositionCurves: [] 17 | m_ScaleCurves: [] 18 | m_FloatCurves: 19 | - curve: 20 | serializedVersion: 2 21 | m_Curve: 22 | - time: 0 23 | value: 1 24 | inSlope: Infinity 25 | outSlope: Infinity 26 | tangentMode: 31 27 | - time: 1 28 | value: 0 29 | inSlope: Infinity 30 | outSlope: Infinity 31 | tangentMode: 31 32 | m_PreInfinity: 2 33 | m_PostInfinity: 2 34 | m_RotationOrder: 4 35 | attribute: m_Enabled 36 | path: 37 | classID: 23 38 | script: {fileID: 0} 39 | m_PPtrCurves: [] 40 | m_SampleRate: 5 41 | m_WrapMode: 0 42 | m_Bounds: 43 | m_Center: {x: 0, y: 0, z: 0} 44 | m_Extent: {x: 0, y: 0, z: 0} 45 | m_ClipBindingConstant: 46 | genericBindings: 47 | - path: 0 48 | attribute: 3305885265 49 | script: {fileID: 0} 50 | classID: 23 51 | customType: 0 52 | isPPtrCurve: 0 53 | pptrCurveMapping: [] 54 | m_AnimationClipSettings: 55 | serializedVersion: 2 56 | m_AdditiveReferencePoseClip: {fileID: 0} 57 | m_AdditiveReferencePoseTime: 0 58 | m_StartTime: 0 59 | m_StopTime: 1 60 | m_OrientationOffsetY: 0 61 | m_Level: 0 62 | m_CycleOffset: 0 63 | m_HasAdditiveReferencePose: 0 64 | m_LoopTime: 0 65 | m_LoopBlend: 0 66 | m_LoopBlendOrientation: 0 67 | m_LoopBlendPositionY: 0 68 | m_LoopBlendPositionXZ: 0 69 | m_KeepOriginalOrientation: 0 70 | m_KeepOriginalPositionY: 1 71 | m_KeepOriginalPositionXZ: 0 72 | m_HeightFromFeet: 0 73 | m_Mirror: 0 74 | m_EditorCurves: 75 | - curve: 76 | serializedVersion: 2 77 | m_Curve: 78 | - time: 0 79 | value: 1 80 | inSlope: Infinity 81 | outSlope: Infinity 82 | tangentMode: 31 83 | - time: 1 84 | value: 0 85 | inSlope: Infinity 86 | outSlope: Infinity 87 | tangentMode: 31 88 | m_PreInfinity: 2 89 | m_PostInfinity: 2 90 | m_RotationOrder: 4 91 | attribute: m_Enabled 92 | path: 93 | classID: 23 94 | script: {fileID: 0} 95 | m_EulerEditorCurves: [] 96 | m_HasGenericRootTransform: 0 97 | m_HasMotionFloatCurves: 0 98 | m_GenerateMotionCurves: 0 99 | m_Events: [] 100 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Prefabs/HeadsUpDirectionIndicatorPointerNegativeX.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000011548036238} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000011548036238 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000014059916104} 22 | - 33: {fileID: 33000010229368812} 23 | - 64: {fileID: 64000010153292146} 24 | - 23: {fileID: 23000013257091402} 25 | m_Layer: 0 26 | m_Name: HeadsUpDirectionIndicatorPointerNegativeX 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000014059916104 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000011548036238} 38 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 39 | m_LocalPosition: {x: 0, y: -0.5, z: 0} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!23 &23000013257091402 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000011548036238} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 0 54 | m_MotionVectors: 0 55 | m_LightProbeUsage: 0 56 | m_ReflectionProbeUsage: 0 57 | m_Materials: 58 | - {fileID: 2100000, guid: d5dc2bf4ebf133145875c7dd415b5199, type: 2} 59 | m_SubsetIndices: 60 | m_StaticBatchRoot: {fileID: 0} 61 | m_ProbeAnchor: {fileID: 0} 62 | m_LightProbeVolumeOverride: {fileID: 0} 63 | m_ScaleInLightmap: 1 64 | m_PreserveUVs: 1 65 | m_IgnoreNormalsForChartDetection: 0 66 | m_ImportantGI: 0 67 | m_SelectedWireframeHidden: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingOrder: 0 74 | --- !u!33 &33000010229368812 75 | MeshFilter: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000011548036238} 80 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 81 | --- !u!64 &64000010153292146 82 | MeshCollider: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1000011548036238} 87 | m_Material: {fileID: 0} 88 | m_IsTrigger: 0 89 | m_Enabled: 1 90 | serializedVersion: 2 91 | m_Convex: 0 92 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 93 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Prefabs/HeadsUpDirectionIndicatorPointerNegativeY.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000010825686122} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000010825686122 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000010336318484} 22 | - 33: {fileID: 33000014227367314} 23 | - 64: {fileID: 64000013000997492} 24 | - 23: {fileID: 23000013709505728} 25 | m_Layer: 0 26 | m_Name: HeadsUpDirectionIndicatorPointerNegativeY 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000010336318484 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000010825686122} 38 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 39 | m_LocalPosition: {x: 0, y: -0.5, z: 0} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!23 &23000013709505728 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000010825686122} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 0 54 | m_MotionVectors: 0 55 | m_LightProbeUsage: 0 56 | m_ReflectionProbeUsage: 0 57 | m_Materials: 58 | - {fileID: 2100000, guid: fe53bb0b3f947354598a7c92510ba76f, type: 2} 59 | m_SubsetIndices: 60 | m_StaticBatchRoot: {fileID: 0} 61 | m_ProbeAnchor: {fileID: 0} 62 | m_LightProbeVolumeOverride: {fileID: 0} 63 | m_ScaleInLightmap: 1 64 | m_PreserveUVs: 1 65 | m_IgnoreNormalsForChartDetection: 0 66 | m_ImportantGI: 0 67 | m_SelectedWireframeHidden: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingOrder: 0 74 | --- !u!33 &33000014227367314 75 | MeshFilter: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000010825686122} 80 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 81 | --- !u!64 &64000013000997492 82 | MeshCollider: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1000010825686122} 87 | m_Material: {fileID: 0} 88 | m_IsTrigger: 0 89 | m_Enabled: 1 90 | serializedVersion: 2 91 | m_Convex: 0 92 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 93 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Prefabs/HeadsUpDirectionIndicatorPointerNegativeZ.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000013129676886} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000013129676886 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000013602146528} 22 | - 33: {fileID: 33000013919345510} 23 | - 64: {fileID: 64000011860684068} 24 | - 23: {fileID: 23000012577549996} 25 | m_Layer: 0 26 | m_Name: HeadsUpDirectionIndicatorPointerNegativeZ 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000013602146528 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000013129676886} 38 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 39 | m_LocalPosition: {x: 0, y: -0.5, z: 0} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!23 &23000012577549996 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000013129676886} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 0 54 | m_MotionVectors: 0 55 | m_LightProbeUsage: 0 56 | m_ReflectionProbeUsage: 0 57 | m_Materials: 58 | - {fileID: 2100000, guid: a632459d61a1e2f44974b9a15188590b, type: 2} 59 | m_SubsetIndices: 60 | m_StaticBatchRoot: {fileID: 0} 61 | m_ProbeAnchor: {fileID: 0} 62 | m_LightProbeVolumeOverride: {fileID: 0} 63 | m_ScaleInLightmap: 1 64 | m_PreserveUVs: 1 65 | m_IgnoreNormalsForChartDetection: 0 66 | m_ImportantGI: 0 67 | m_SelectedWireframeHidden: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingOrder: 0 74 | --- !u!33 &33000013919345510 75 | MeshFilter: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000013129676886} 80 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 81 | --- !u!64 &64000011860684068 82 | MeshCollider: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1000013129676886} 87 | m_Material: {fileID: 0} 88 | m_IsTrigger: 0 89 | m_Enabled: 1 90 | serializedVersion: 2 91 | m_Convex: 0 92 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 93 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Prefabs/HeadsUpDirectionIndicatorPointerPositiveX.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000013082263154} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000013082263154 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000011274691914} 22 | - 33: {fileID: 33000012067659496} 23 | - 64: {fileID: 64000010137686560} 24 | - 23: {fileID: 23000010384920880} 25 | m_Layer: 0 26 | m_Name: HeadsUpDirectionIndicatorPointerPositiveX 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000011274691914 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000013082263154} 38 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 39 | m_LocalPosition: {x: 0, y: -0.5, z: 0} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!23 &23000010384920880 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000013082263154} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 0 54 | m_MotionVectors: 0 55 | m_LightProbeUsage: 0 56 | m_ReflectionProbeUsage: 0 57 | m_Materials: 58 | - {fileID: 2100000, guid: 58f3055bd700ca141b184d84f9b91d19, type: 2} 59 | m_SubsetIndices: 60 | m_StaticBatchRoot: {fileID: 0} 61 | m_ProbeAnchor: {fileID: 0} 62 | m_LightProbeVolumeOverride: {fileID: 0} 63 | m_ScaleInLightmap: 1 64 | m_PreserveUVs: 1 65 | m_IgnoreNormalsForChartDetection: 0 66 | m_ImportantGI: 0 67 | m_SelectedWireframeHidden: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingOrder: 0 74 | --- !u!33 &33000012067659496 75 | MeshFilter: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000013082263154} 80 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 81 | --- !u!64 &64000010137686560 82 | MeshCollider: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1000013082263154} 87 | m_Material: {fileID: 0} 88 | m_IsTrigger: 0 89 | m_Enabled: 1 90 | serializedVersion: 2 91 | m_Convex: 0 92 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 93 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Prefabs/HeadsUpDirectionIndicatorPointerPositiveY.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000010991577574} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000010991577574 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000010509302214} 22 | - 33: {fileID: 33000010305388630} 23 | - 64: {fileID: 64000012834806524} 24 | - 23: {fileID: 23000012546826062} 25 | m_Layer: 0 26 | m_Name: HeadsUpDirectionIndicatorPointerPositiveY 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000010509302214 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000010991577574} 38 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 39 | m_LocalPosition: {x: 0, y: -0.5, z: 0} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!23 &23000012546826062 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000010991577574} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 0 54 | m_MotionVectors: 0 55 | m_LightProbeUsage: 0 56 | m_ReflectionProbeUsage: 0 57 | m_Materials: 58 | - {fileID: 2100000, guid: 658a6f68bb2c1ce41b917905a69ee69b, type: 2} 59 | m_SubsetIndices: 60 | m_StaticBatchRoot: {fileID: 0} 61 | m_ProbeAnchor: {fileID: 0} 62 | m_LightProbeVolumeOverride: {fileID: 0} 63 | m_ScaleInLightmap: 1 64 | m_PreserveUVs: 1 65 | m_IgnoreNormalsForChartDetection: 0 66 | m_ImportantGI: 0 67 | m_SelectedWireframeHidden: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingOrder: 0 74 | --- !u!33 &33000010305388630 75 | MeshFilter: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000010991577574} 80 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 81 | --- !u!64 &64000012834806524 82 | MeshCollider: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1000010991577574} 87 | m_Material: {fileID: 0} 88 | m_IsTrigger: 0 89 | m_Enabled: 1 90 | serializedVersion: 2 91 | m_Convex: 0 92 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 93 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Prefabs/HeadsUpDirectionIndicatorPointerPositiveZ.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000010930187558} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000010930187558 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000010598626706} 22 | - 33: {fileID: 33000013187099496} 23 | - 64: {fileID: 64000012437355248} 24 | - 23: {fileID: 23000011472790176} 25 | m_Layer: 0 26 | m_Name: HeadsUpDirectionIndicatorPointerPositiveZ 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000010598626706 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000010930187558} 38 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 39 | m_LocalPosition: {x: 0, y: -0.5, z: 0} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!23 &23000011472790176 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000010930187558} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 0 54 | m_MotionVectors: 0 55 | m_LightProbeUsage: 0 56 | m_ReflectionProbeUsage: 0 57 | m_Materials: 58 | - {fileID: 2100000, guid: 19692cbacfc17ab4d80c2d73c21b9855, type: 2} 59 | m_SubsetIndices: 60 | m_StaticBatchRoot: {fileID: 0} 61 | m_ProbeAnchor: {fileID: 0} 62 | m_LightProbeVolumeOverride: {fileID: 0} 63 | m_ScaleInLightmap: 1 64 | m_PreserveUVs: 1 65 | m_IgnoreNormalsForChartDetection: 0 66 | m_ImportantGI: 0 67 | m_SelectedWireframeHidden: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingOrder: 0 74 | --- !u!33 &33000013187099496 75 | MeshFilter: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000010930187558} 80 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 81 | --- !u!64 &64000012437355248 82 | MeshCollider: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1000010930187558} 87 | m_Material: {fileID: 0} 88 | m_IsTrigger: 0 89 | m_Enabled: 1 90 | serializedVersion: 2 91 | m_Convex: 0 92 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 93 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Prefabs/dot.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &148770 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 423548} 11 | - 33: {fileID: 3304896} 12 | - 23: {fileID: 2393278} 13 | m_Layer: 0 14 | m_Name: dot 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &423548 21 | Transform: 22 | m_ObjectHideFlags: 1 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | m_GameObject: {fileID: 148770} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: 0, y: 0, z: 0} 28 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 29 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | --- !u!23 &2393278 34 | MeshRenderer: 35 | m_ObjectHideFlags: 1 36 | m_PrefabParentObject: {fileID: 0} 37 | m_PrefabInternal: {fileID: 100100000} 38 | m_GameObject: {fileID: 148770} 39 | m_Enabled: 1 40 | m_CastShadows: 1 41 | m_ReceiveShadows: 1 42 | m_MotionVectors: 1 43 | m_LightProbeUsage: 1 44 | m_ReflectionProbeUsage: 1 45 | m_Materials: 46 | - {fileID: 2100000, guid: 474f0e0481d4aa14e92a5ada98042f3a, type: 2} 47 | m_SubsetIndices: 48 | m_StaticBatchRoot: {fileID: 0} 49 | m_ProbeAnchor: {fileID: 0} 50 | m_LightProbeVolumeOverride: {fileID: 0} 51 | m_ScaleInLightmap: 1 52 | m_PreserveUVs: 1 53 | m_IgnoreNormalsForChartDetection: 0 54 | m_ImportantGI: 0 55 | m_SelectedWireframeHidden: 0 56 | m_MinimumChartSize: 4 57 | m_AutoUVMaxDistance: 0.5 58 | m_AutoUVMaxAngle: 89 59 | m_LightmapParameters: {fileID: 0} 60 | m_SortingLayerID: 0 61 | m_SortingOrder: 0 62 | --- !u!33 &3304896 63 | MeshFilter: 64 | m_ObjectHideFlags: 1 65 | m_PrefabParentObject: {fileID: 0} 66 | m_PrefabInternal: {fileID: 100100000} 67 | m_GameObject: {fileID: 148770} 68 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 69 | --- !u!1001 &100100000 70 | Prefab: 71 | m_ObjectHideFlags: 1 72 | serializedVersion: 2 73 | m_Modification: 74 | m_TransformParent: {fileID: 0} 75 | m_Modifications: [] 76 | m_RemovedComponents: [] 77 | m_ParentPrefab: {fileID: 0} 78 | m_RootGameObject: {fileID: 148770} 79 | m_IsPrefabParent: 1 80 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Scripts/GestureResponder.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using HoloToolkit.Unity.InputModule; 3 | 4 | public class GestureResponder : MonoBehaviour, IInputClickHandler 5 | { 6 | private void Start() 7 | { 8 | InputManager.Instance.PushFallbackInputHandler(gameObject); 9 | } 10 | 11 | public void OnInputClicked(InputEventData eventData) 12 | { 13 | PlaneTargetGroupPicker.Instance.PickNewTarget(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Scripts/PlaneTargetGroup.cs: -------------------------------------------------------------------------------- 1 | // Copyright Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using System.Collections; 6 | 7 | public class PlaneTargetGroup : MonoBehaviour 8 | { 9 | [Tooltip("Enter in same target consecutively to turn on velocity tracking for that target.")] 10 | public Transform[] Targets; 11 | 12 | public bool UseVelocity 13 | { 14 | get; 15 | private set; 16 | } 17 | 18 | [HideInInspector] 19 | public Transform CurrentTarget; 20 | private int currentTargetIndex; 21 | 22 | private void Start() 23 | { 24 | currentTargetIndex = 0; 25 | if (Targets.Length > 0) 26 | { 27 | CurrentTarget = Targets[currentTargetIndex]; 28 | } 29 | } 30 | 31 | // Pick a new target within this group. Targets are cycled through in 32 | // the order in which they exist in the Targets property. Velocity can 33 | // be tracked for targets if they exist in Targets array twice and 34 | // consecutively 35 | public void PickNewTarget() 36 | { 37 | if (Targets.Length == 0) 38 | { 39 | return; 40 | } 41 | 42 | UseVelocity = false; 43 | 44 | ++currentTargetIndex; 45 | currentTargetIndex %= Targets.Length; 46 | 47 | // Track velocity for consecutive duplicate entries 48 | Transform newTarget = Targets[currentTargetIndex]; 49 | if (CurrentTarget == newTarget) 50 | { 51 | UseVelocity = true; 52 | } 53 | CurrentTarget = newTarget; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Scripts/PlaneTargetGroupPicker.cs: -------------------------------------------------------------------------------- 1 | // Copyright Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using System.Collections; 6 | using HoloToolkit.Unity; 7 | 8 | public class PlaneTargetGroupPicker : Singleton 9 | { 10 | [Tooltip("In degrees")] 11 | public float AngleOfAcceptance = 45.0f; 12 | public PlaneTargetGroup[] Groups; 13 | 14 | public TextMesh DisplayText; 15 | public float TextDisplayTime = 5.0f; 16 | 17 | private PlaneTargetGroup currentGroup; 18 | 19 | private Coroutine displayForSecondsCoroutine; 20 | 21 | public void PickNewTarget() 22 | { 23 | PlaneTargetGroup newGroup = null; 24 | float smallestAngle = float.PositiveInfinity; 25 | 26 | // Figure out which group we're looking at 27 | foreach (PlaneTargetGroup group in Groups) 28 | { 29 | Vector3 camToGroup = group.transform.position - Camera.main.transform.position; 30 | float gazeObjectAngle = Vector3.Angle(camToGroup, Camera.main.transform.forward); 31 | if (group.Targets.Length > 0 && gazeObjectAngle < AngleOfAcceptance && gazeObjectAngle < smallestAngle) 32 | { 33 | smallestAngle = gazeObjectAngle; 34 | newGroup = group; 35 | } 36 | } 37 | 38 | // Looking at a group! 39 | if (newGroup != null) 40 | { 41 | // If we're already in this group, switch targets 42 | if (newGroup == currentGroup) 43 | { 44 | newGroup.PickNewTarget(); 45 | } 46 | currentGroup = newGroup; 47 | StabilizationPlaneModifier.Instance.TargetOverride = currentGroup.CurrentTarget.transform; 48 | StabilizationPlaneModifier.Instance.TrackVelocity = currentGroup.UseVelocity; 49 | UpdateText(); 50 | } 51 | } 52 | 53 | private void UpdateText() 54 | { 55 | DisplayText.text = StabilizationPlaneModifier.Instance.TargetOverride.name; 56 | if (StabilizationPlaneModifier.Instance.TrackVelocity) 57 | { 58 | DisplayText.text += "\r\nvelocity"; 59 | } 60 | 61 | if (displayForSecondsCoroutine != null) 62 | { 63 | StopCoroutine(displayForSecondsCoroutine); 64 | } 65 | displayForSecondsCoroutine = StartCoroutine(DisplayForSeconds(TextDisplayTime)); 66 | } 67 | 68 | private IEnumerator DisplayForSeconds(float displayTime) 69 | { 70 | yield return new WaitForSeconds(displayTime); 71 | DisplayText.text = ""; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Scripts/TextToSpeechManagerTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.VR.WSA.Input; 4 | using UnityEngine.Windows.Speech; 5 | using HoloToolkit.Unity; 6 | using System; 7 | using HoloToolkit.Unity.InputModule; 8 | 9 | public class TextToSpeechManagerTest : MonoBehaviour 10 | { 11 | private GestureRecognizer gestureRecognizer; 12 | public TextToSpeechManager textToSpeechManager; 13 | 14 | // Use this for initialization 15 | void Start () 16 | { 17 | // Set up a GestureRecognizer to detect Select gestures. 18 | gestureRecognizer = new GestureRecognizer(); 19 | gestureRecognizer.TappedEvent += GestureRecognizer_TappedEvent; 20 | gestureRecognizer.StartCapturingGestures(); 21 | } 22 | 23 | private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay) 24 | { 25 | GazeManager gm = GazeManager.Instance; 26 | if (gm.IsGazingAtObject) 27 | { 28 | // Get the target object 29 | GameObject obj = gm.HitInfo.collider.gameObject; 30 | 31 | // Try and get a TTS Manager 32 | TextToSpeechManager tts = null; 33 | if (obj != null) 34 | { 35 | tts = obj.GetComponent(); 36 | } 37 | 38 | // If we have a text to speech manager on the target object, say something. 39 | // This voice will appear to emanate from the object. 40 | if (tts != null && !tts.IsSpeaking()) 41 | { 42 | // Get the name 43 | var voiceName = Enum.GetName(typeof(TextToSpeechVoice), tts.Voice); 44 | 45 | // Create message 46 | var msg = string.Format("This is the {0} voice. It should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.", voiceName); 47 | 48 | // Speak message 49 | tts.SpeakText(msg); 50 | } 51 | else if (tts.IsSpeaking()) 52 | { 53 | tts.StopSpeaking(); 54 | } 55 | } 56 | } 57 | 58 | public void SpeakTime() 59 | { 60 | // Say something using the text to speech manager on THIS test class (the "global" one). 61 | // This voice will appear to follow the user. 62 | textToSpeechManager.SpeakText("The time is " + DateTime.Now.ToString("t")); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Scripts/TextToSpeechOnTap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using HoloToolkit.Unity.InputModule; 4 | 5 | namespace HoloToolkit.Unity.Tests 6 | { 7 | public class TextToSpeechOnTap : MonoBehaviour, IInputClickHandler 8 | { 9 | public TextToSpeechManager TextToSpeech; 10 | 11 | public void OnInputClicked(InputEventData eventData) 12 | { 13 | // If we have a text to speech manager on the target object, say something. 14 | // This voice will appear to emanate from the object. 15 | if (TextToSpeech != null) 16 | { 17 | // Get the name 18 | var voiceName = Enum.GetName(typeof(TextToSpeechVoice), TextToSpeech.Voice); 19 | 20 | // Create message 21 | var msg = string.Format("This is the {0} voice. It should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.", voiceName); 22 | 23 | // Speak message 24 | TextToSpeech.SpeakText(msg); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowNegativeX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowNegativeX.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowNegativeY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowNegativeY.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowNegativeZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowNegativeZ.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowPositiveX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowPositiveX.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowPositiveY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowPositiveY.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowPositiveZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/ArrowPositiveZ.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/NegativeX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/NegativeX.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/NegativeY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/NegativeY.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/NegativeZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/NegativeZ.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/PositiveX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/PositiveX.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/PositiveY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/PositiveY.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/PositiveZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Tests/Textures/PositiveZ.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Textures/Arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/HoloToolkit/Utilities/Textures/Arrow.png -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/Placeholder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | #if UNITY_UWP && !UNITY_EDITOR 6 | using SimpleUwpTwoWayComms; 7 | using System.Threading.Tasks; 8 | #endif 9 | 10 | public class Placeholder : MonoBehaviour 11 | { 12 | public GameObject panelConnection; 13 | public GameObject panelColours; 14 | public GameObject cube; 15 | 16 | public void OnAdvertise() 17 | { 18 | #if UNITY_UWP && !UNITY_EDITOR 19 | this.OnInitialiseAsync(); 20 | #endif 21 | } 22 | public void OnConnect() 23 | { 24 | #if UNITY_UWP && !UNITY_EDITOR 25 | this.OnInitialiseAsync(false); 26 | #endif 27 | } 28 | public void OnRed() 29 | { 30 | this.OnColour(Color.red); 31 | } 32 | public void OnGreen() 33 | { 34 | this.OnColour(Color.green); 35 | } 36 | public void OnBlue() 37 | { 38 | this.OnColour(Color.blue); 39 | } 40 | public void OnColour(Color colour) 41 | { 42 | // Convert 0 to 1 values into bytes so that we can be compatible with the 2D XAML 43 | // app. 44 | var message = new byte[] 45 | { 46 | (byte)(colour.r * 255.0f), 47 | (byte)(colour.g * 255.0f), 48 | (byte)(colour.b * 255.0f) 49 | }; 50 | 51 | #if UNITY_UWP && !UNITY_EDITOR 52 | this.OnColourAsync(message); 53 | #endif 54 | } 55 | void Dispatch(Action action) 56 | { 57 | UnityEngine.WSA.Application.InvokeOnAppThread(() => 58 | { 59 | action(); 60 | }, 61 | false); 62 | } 63 | #if UNITY_UWP && !UNITY_EDITOR 64 | async Task OnColourAsync(byte[] bits) 65 | { 66 | await this.pipe.SendBytesAsync(bits); 67 | } 68 | 69 | async Task OnInitialiseAsync(bool advertise = true) 70 | { 71 | if (this.pipe == null) 72 | { 73 | this.pipe = new AutoConnectMessagePipe(advertise); 74 | } 75 | 76 | await this.pipe.WaitForConnectionAsync(TimeSpan.FromMilliseconds(-1)); 77 | 78 | if (pipe.IsConnected) 79 | { 80 | this.TogglePanels(false); 81 | await this.pipe.ReadAndDispatchMessageLoopAsync(this.MessageHandler); 82 | this.TogglePanels(true); 83 | } 84 | } 85 | void TogglePanels(bool connectionPanel) 86 | { 87 | this.Dispatch( 88 | () => 89 | { 90 | this.panelConnection.SetActive(connectionPanel); 91 | this.panelColours.SetActive(!connectionPanel); 92 | } 93 | ); 94 | } 95 | void MessageHandler(MessageType messageType, object messageBody) 96 | { 97 | // We just handle byte arrays here. 98 | if (messageType == MessageType.Buffer) 99 | { 100 | var bits = (byte[])messageBody; 101 | 102 | if (bits != null) 103 | { 104 | this.Dispatch(() => 105 | { 106 | this.cube.GetComponent().material.color = 107 | new Color( 108 | (float)(bits[0]) / 255.0f, 109 | (float)(bits[1]) / 255.0f, 110 | (float)(bits[2] / 255.0f)); 111 | } 112 | ); 113 | } 114 | } 115 | } 116 | AutoConnectMessagePipe pipe; 117 | #endif 118 | } -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/Assets/SimpleUwpTwoWayComms.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/UnityHoloLensTestApp/HoloLensTestApp/Assets/SimpleUwpTwoWayComms.dll -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | m_VirtualizeEffects: 1 17 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/MainScene.unity 10 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_DefaultBehaviorMode: 0 10 | m_SpritePackerMode: 2 11 | m_SpritePackerPaddingPower: 1 12 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 13 | m_ProjectGenerationRootNamespace: 14 | m_UserGeneratedProjectSuffix: 15 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_TierSettings_Tier1: 43 | renderingPath: 1 44 | useCascadedShadowMaps: 0 45 | m_TierSettings_Tier2: 46 | renderingPath: 1 47 | useCascadedShadowMaps: 1 48 | m_TierSettings_Tier3: 49 | renderingPath: 1 50 | useCascadedShadowMaps: 1 51 | m_DefaultRenderingPath: 1 52 | m_DefaultMobileRenderingPath: 1 53 | m_TierSettings: [] 54 | m_LightmapStripping: 0 55 | m_FogStripping: 0 56 | m_LightmapKeepPlain: 1 57 | m_LightmapKeepDirCombined: 1 58 | m_LightmapKeepDirSeparate: 1 59 | m_LightmapKeepDynamicPlain: 1 60 | m_LightmapKeepDynamicDirCombined: 1 61 | m_LightmapKeepDynamicDirSeparate: 1 62 | m_FogKeepLinear: 1 63 | m_FogKeepExp: 1 64 | m_FogKeepExp2: 1 65 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_MinPenetrationForPenalty: 0.01 17 | m_BaumgarteScale: 0.2 18 | m_BaumgarteTimeOfImpactScale: 0.75 19 | m_TimeToSleep: 0.5 20 | m_LinearSleepTolerance: 0.01 21 | m_AngularSleepTolerance: 2 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_AlwaysShowColliders: 0 26 | m_ShowColliderSleep: 1 27 | m_ShowColliderContacts: 0 28 | m_ShowColliderAABB: 0 29 | m_ContactArrowScale: 0.2 30 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 31 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 32 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 33 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 34 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 35 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.5.0f3 2 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /UnityHoloLensTestApp/HoloLensTestApp/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | CrashReportingSettings: 11 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 12 | m_Enabled: 0 13 | m_CaptureEditorExceptions: 1 14 | UnityPurchasingSettings: 15 | m_Enabled: 0 16 | m_TestMode: 0 17 | UnityAnalyticsSettings: 18 | m_Enabled: 1 19 | m_InitializeOnStartup: 1 20 | m_TestMode: 0 21 | m_TestEventUrl: 22 | m_TestConfigUrl: 23 | UnityAdsSettings: 24 | m_Enabled: 0 25 | m_InitializeOnStartup: 1 26 | m_TestMode: 0 27 | m_EnabledPlatforms: 4294967295 28 | m_IosGameId: 29 | m_AndroidGameId: 30 | -------------------------------------------------------------------------------- /XamlTestApp/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /XamlTestApp/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace XamlTestApp 2 | { 3 | using Windows.ApplicationModel.Activation; 4 | using Windows.UI.Xaml; 5 | 6 | sealed partial class App : Application 7 | { 8 | public App() 9 | { 10 | this.InitializeComponent(); 11 | } 12 | protected override void OnLaunched(LaunchActivatedEventArgs e) 13 | { 14 | if (e.PrelaunchActivated == false) 15 | { 16 | if (Window.Current.Content == null) 17 | { 18 | Window.Current.Content = new MainControl(); 19 | } 20 | Window.Current.Activate(); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /XamlTestApp/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/XamlTestApp/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /XamlTestApp/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/XamlTestApp/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /XamlTestApp/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/XamlTestApp/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /XamlTestApp/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/XamlTestApp/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /XamlTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/XamlTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /XamlTestApp/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/XamlTestApp/Assets/StoreLogo.png -------------------------------------------------------------------------------- /XamlTestApp/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mtaulty/SimpleUwpTwoWayComms/516c6b630fcefa88435a6d76948ae96fc2fbb856/XamlTestApp/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /XamlTestApp/NotConverter.cs: -------------------------------------------------------------------------------- 1 | namespace XamlTestApp 2 | { 3 | using System; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Data; 6 | 7 | public class InverseVisibilityConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, string language) 10 | { 11 | return ((bool)value ? Visibility.Collapsed : Visibility.Visible); 12 | } 13 | 14 | public object ConvertBack(object value, Type targetType, object parameter, string language) 15 | { 16 | throw new InvalidOperationException(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /XamlTestApp/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | XamlTestApp 7 | mtaulty 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /XamlTestApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XamlTestApp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("XamlTestApp")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /XamlTestApp/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /XamlTestApp/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0" 4 | }, 5 | "frameworks": { 6 | "uap10.0": {} 7 | }, 8 | "runtimes": { 9 | "win10-arm": {}, 10 | "win10-arm-aot": {}, 11 | "win10-x86": {}, 12 | "win10-x86-aot": {}, 13 | "win10-x64": {}, 14 | "win10-x64-aot": {} 15 | } 16 | } --------------------------------------------------------------------------------