From 371f7de908ad9d0304b3662e441ea143c287f057 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 26 Sep 2017 16:10:27 -0700 Subject: [PATCH 01/25] Removed static flags on text mesh components --- .../Input/Scenes/InputManagerTest.unity | 240 +++++++++++++++--- 1 file changed, 203 insertions(+), 37 deletions(-) diff --git a/Assets/HoloToolkit-Tests/Input/Scenes/InputManagerTest.unity b/Assets/HoloToolkit-Tests/Input/Scenes/InputManagerTest.unity index 935951fdc9b..1191eb984c9 100644 --- a/Assets/HoloToolkit-Tests/Input/Scenes/InputManagerTest.unity +++ b/Assets/HoloToolkit-Tests/Input/Scenes/InputManagerTest.unity @@ -42,7 +42,7 @@ RenderSettings: --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 9 + serializedVersion: 11 m_GIWorkflowMode: 1 m_GISettings: serializedVersion: 2 @@ -54,7 +54,7 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 8 + serializedVersion: 9 m_Resolution: 2 m_BakeResolution: 40 m_TextureWidth: 1024 @@ -77,17 +77,19 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 m_PVRFilteringMode: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 m_LightingDataAsset: {fileID: 0} - m_ShadowMaskMode: 2 + m_UseShadowmask: 1 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -107,6 +109,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &41734711 GameObject: @@ -148,6 +152,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -163,6 +168,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -230,6 +236,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 0 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -245,6 +252,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -399,6 +407,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -414,6 +423,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -469,7 +479,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &149404909 Transform: @@ -514,6 +524,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -529,6 +540,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -588,7 +600,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &173363922 Transform: @@ -633,6 +645,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -648,6 +661,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -671,7 +685,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &200945359 Transform: @@ -716,6 +730,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -731,6 +746,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -822,6 +838,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -930,6 +954,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 0 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -945,6 +970,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1017,6 +1043,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1032,6 +1059,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1074,7 +1102,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &263170636 Transform: @@ -1119,6 +1147,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1134,6 +1163,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1157,7 +1187,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &350032155 Transform: @@ -1202,6 +1232,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1217,6 +1248,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1337,6 +1369,14 @@ Prefab: propertyPath: m_Layer value: 0 objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -1402,7 +1442,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 432117531} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 1.1980001} + m_LocalPosition: {x: 0.049999237, y: 0.47200012, z: 1.1980001} m_LocalScale: {x: 0.003, y: 0.003, z: 0.003} m_Children: - {fileID: 1034968948} @@ -1559,6 +1599,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1574,6 +1615,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1617,7 +1659,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &502235478 Transform: @@ -1664,6 +1706,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1679,6 +1722,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1717,7 +1761,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &556584198 Transform: @@ -1762,6 +1806,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1777,6 +1822,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1887,6 +1933,14 @@ Prefab: propertyPath: m_LocalScale.z value: 2.5 objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -1906,7 +1960,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &689950062 Transform: @@ -1953,6 +2007,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1968,6 +2023,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2086,6 +2142,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2101,6 +2158,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2132,7 +2190,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &736112370 Transform: @@ -2177,6 +2235,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2192,6 +2251,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2226,7 +2286,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &764860895 Transform: @@ -2273,6 +2333,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2288,6 +2349,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2418,7 +2480,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &962930258 Transform: @@ -2463,6 +2525,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2478,6 +2541,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2506,7 +2570,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &984922568 Transform: @@ -2555,6 +2619,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2570,6 +2635,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2671,6 +2737,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -2722,7 +2796,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1034531162 Transform: @@ -2767,6 +2841,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2782,6 +2857,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2971,6 +3047,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 0 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2986,6 +3063,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3067,7 +3145,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 198000010086851302, guid: 31ed45da60c98354380578a9bde4814d, type: 2} - propertyPath: ShapeModule.radius + propertyPath: ShapeModule.radius.value value: 0.02237308 objectReference: {fileID: 0} m_RemovedComponents: [] @@ -3201,6 +3279,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -3367,7 +3453,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1248870586 Transform: @@ -3412,6 +3498,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3427,6 +3514,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3480,6 +3568,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3495,6 +3584,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3592,8 +3682,9 @@ MonoBehaviour: m_EditorClassIdentifier: HostTransform: {fileID: 0} DistanceScale: 2 - IsKeepUpright: 0 - IsOrientTowardsUser: 1 + RotationMode: 0 + PositionLerpSpeed: 0.2 + RotationLerpSpeed: 0.2 IsDraggingEnabled: 1 --- !u!23 &1282283563 MeshRenderer: @@ -3604,6 +3695,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3619,6 +3711,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3674,6 +3767,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3689,6 +3783,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3874,6 +3969,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4074,7 +4177,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1549854632 Transform: @@ -4123,6 +4226,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4138,6 +4242,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4243,6 +4348,14 @@ Prefab: propertyPath: m_Layer value: 0 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4274,6 +4387,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4289,6 +4403,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4412,6 +4527,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4441,7 +4564,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1595405691 Transform: @@ -4488,6 +4611,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4503,6 +4627,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4566,6 +4691,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4581,6 +4707,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4617,7 +4744,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1614035368 Transform: @@ -4662,6 +4789,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4677,6 +4805,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4776,6 +4905,14 @@ Prefab: propertyPath: m_LocalScale.z value: 1.2 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4855,6 +4992,14 @@ Prefab: propertyPath: m_Layer value: 0 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4954,6 +5099,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4969,6 +5115,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5000,7 +5147,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1708006763 Transform: @@ -5045,6 +5192,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5060,6 +5208,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5162,7 +5311,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1833810248 Transform: @@ -5211,6 +5360,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5226,6 +5376,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5313,6 +5464,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5328,6 +5480,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5370,7 +5523,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1906609831 Transform: @@ -5417,6 +5570,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5432,6 +5586,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5455,7 +5610,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1925794794 Transform: @@ -5500,6 +5655,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5515,6 +5671,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5581,8 +5738,9 @@ MonoBehaviour: m_EditorClassIdentifier: HostTransform: {fileID: 0} DistanceScale: 2 - IsKeepUpright: 0 - IsOrientTowardsUser: 1 + RotationMode: 0 + PositionLerpSpeed: 0.2 + RotationLerpSpeed: 0.2 IsDraggingEnabled: 1 --- !u!23 &1950385221 MeshRenderer: @@ -5593,6 +5751,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5608,6 +5767,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5650,7 +5810,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1964882465 Transform: @@ -5697,6 +5857,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5712,6 +5873,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5814,7 +5976,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &2091656258 Transform: @@ -5863,6 +6025,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5878,6 +6041,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5901,7 +6065,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &2128781368 Transform: @@ -5946,6 +6110,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5961,6 +6126,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 From f77f8e6ce0553ecabba1926369561c9da5253797 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 26 Sep 2017 18:49:17 -0700 Subject: [PATCH 02/25] First pass at Input System Update. --- .../Boundary/Scripts/BoundaryTest.cs | 15 +- .../Input/Scripts/HapticsTest.cs | 9 +- .../Input/Scripts/InputHandleCallbackFX.cs | 3 +- .../Input/Scripts/SphereGlobalKeywords.cs | 2 +- .../Input/Scripts/SphereKeywords.cs | 2 +- .../Scripts/TextToSpeechOnTapTest.cs | 3 +- .../Boundary/Scripts/BoundaryManager.cs | 6 +- .../Scripts/Gaze/MixedRealityTeleport.cs | 9 +- .../InputEventData/InputClickedEventData.cs | 3 +- .../Scripts/InputEventData/InputEventData.cs | 7 +- .../InputEventData/InputPositionEventData.cs | 5 +- ...ognizedEventData.cs => SpeechEventData.cs} | 11 +- ...ntData.cs.meta => SpeechEventData.cs.meta} | 0 .../Scripts/InputHandlers/ISpeechHandler.cs | 2 +- .../HoloToolkit/Input/Scripts/InputManager.cs | 28 ++- .../Scripts/InputSources/BaseInputSource.cs | 3 +- .../Scripts/InputSources/EditorInputSource.cs | 30 +-- .../InputSources/GamePadInputSource.cs | 5 +- .../Scripts/InputSources/GamepadInput.cs | 18 +- .../Scripts/InputSources/IInputSource.cs | 3 +- .../InteractionSourceInputSource.cs | 185 +++++++++--------- .../Microphone/DictationInputManager.cs | 5 +- .../Input/Scripts/UI/TriggerButton.cs | 3 +- .../Utilities/InteractionSourceInfo.cs | 13 ++ .../Utilities/InteractionSourceInfo.cs.meta | 13 ++ .../Utilities/InteractionSourcePressInfo.cs | 15 ++ .../InteractionSourcePressInfo.cs.meta | 13 ++ .../Utilities/MixedRealityCameraManager.cs | 24 ++- .../Input/Scripts/Voice/SpeechInputHandler.cs | 2 +- .../Input/Scripts/Voice/SpeechInputSource.cs | 15 +- .../Scripts/PlayerController.cs | 10 +- .../Scripts/UNetSharedHologram.cs | 23 +-- .../ScrollingSessionListUIController.cs | 9 +- .../UI/Scripts/StartSessionButton.cs | 4 +- .../Scripts/DebugPanelControllerInfo.cs | 11 +- .../Utilities/Scripts/HeadsetAdjustment.cs | 2 +- 36 files changed, 306 insertions(+), 205 deletions(-) rename Assets/HoloToolkit/Input/Scripts/InputEventData/{SpeechKeywordRecognizedEventData.cs => SpeechEventData.cs} (89%) rename Assets/HoloToolkit/Input/Scripts/InputEventData/{SpeechKeywordRecognizedEventData.cs.meta => SpeechEventData.cs.meta} (100%) create mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs create mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta create mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs create mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta diff --git a/Assets/HoloToolkit-Tests/Boundary/Scripts/BoundaryTest.cs b/Assets/HoloToolkit-Tests/Boundary/Scripts/BoundaryTest.cs index bda5cc3adaa..88bb34eda53 100644 --- a/Assets/HoloToolkit-Tests/Boundary/Scripts/BoundaryTest.cs +++ b/Assets/HoloToolkit-Tests/Boundary/Scripts/BoundaryTest.cs @@ -7,10 +7,11 @@ namespace HoloToolkit.Unity.Boundary.Tests { public class BoundaryTest : MonoBehaviour { - private Material[] defaultMaterials; + private Material[] defaultMaterials = null; private void Start() { +#if UNITY_WSA BoundaryManager.Instance.RenderBoundary = true; BoundaryManager.Instance.RenderFloor = true; @@ -27,6 +28,18 @@ private void Start() defaultMaterials[i].SetColor("_Color", highlightColor); } } +#else + BoundaryManager.Instance.RenderBoundary = false; + BoundaryManager.Instance.RenderFloor = false; +#endif + } + + private void OnDestroy() + { + for (int i = 0; i < defaultMaterials.Length; i++) + { + Destroy(defaultMaterials[i]); + } } } } diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/HapticsTest.cs b/Assets/HoloToolkit-Tests/Input/Scripts/HapticsTest.cs index 64a872ab548..c69999aad5f 100644 --- a/Assets/HoloToolkit-Tests/Input/Scripts/HapticsTest.cs +++ b/Assets/HoloToolkit-Tests/Input/Scripts/HapticsTest.cs @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using HoloToolkit.Unity.InputModule; using UnityEngine; -using UnityEngine.XR.WSA.Input; +using HoloToolkit.Unity.InputModule; namespace HoloToolkit.Unity.Tests { @@ -17,10 +16,10 @@ void IInputHandler.OnInputDown(InputEventData eventData) { switch (eventData.PressType) { - case InteractionSourcePressType.Grasp: + case InteractionSourcePressInfo.Grasp: inputSource.StartHaptics(eventData.SourceId, 1.0f); return; - case InteractionSourcePressType.Menu: + case InteractionSourcePressInfo.Menu: inputSource.StartHaptics(eventData.SourceId, 1.0f, 1.0f); return; } @@ -32,7 +31,7 @@ void IInputHandler.OnInputUp(InputEventData eventData) InteractionSourceInputSource inputSource = eventData.InputSource as InteractionSourceInputSource; if (inputSource != null) { - if (eventData.PressType == InteractionSourcePressType.Grasp) + if (eventData.PressType == InteractionSourcePressInfo.Grasp) { inputSource.StopHaptics(eventData.SourceId); } diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/InputHandleCallbackFX.cs b/Assets/HoloToolkit-Tests/Input/Scripts/InputHandleCallbackFX.cs index 51ce3893b73..423f481e727 100644 --- a/Assets/HoloToolkit-Tests/Input/Scripts/InputHandleCallbackFX.cs +++ b/Assets/HoloToolkit-Tests/Input/Scripts/InputHandleCallbackFX.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule.Tests { @@ -23,7 +22,7 @@ void IInputHandler.OnInputDown(InputEventData eventData) void IInputHandler.OnInputUp(InputEventData eventData) { - if (eventData.PressType == InteractionSourcePressType.Select) + if (eventData.PressType == InteractionSourcePressInfo.Select) { FocusDetails? focusDetails = FocusManager.Instance.TryGetFocusDetails(eventData); diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/SphereGlobalKeywords.cs b/Assets/HoloToolkit-Tests/Input/Scripts/SphereGlobalKeywords.cs index 1e2399fe668..6c412ac9a73 100644 --- a/Assets/HoloToolkit-Tests/Input/Scripts/SphereGlobalKeywords.cs +++ b/Assets/HoloToolkit-Tests/Input/Scripts/SphereGlobalKeywords.cs @@ -22,7 +22,7 @@ private void Awake() } } - public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) + public void OnSpeechKeywordRecognized(SpeechEventData eventData) { switch (eventData.RecognizedText.ToLower()) { diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/SphereKeywords.cs b/Assets/HoloToolkit-Tests/Input/Scripts/SphereKeywords.cs index 85cafcf890c..de157c715de 100644 --- a/Assets/HoloToolkit-Tests/Input/Scripts/SphereKeywords.cs +++ b/Assets/HoloToolkit-Tests/Input/Scripts/SphereKeywords.cs @@ -38,7 +38,7 @@ public void ResetColor() cachedMaterial.SetColor("_Color", defaultColor); } - public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) + public void OnSpeechKeywordRecognized(SpeechEventData eventData) { ChangeColor(eventData.RecognizedText); } diff --git a/Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs b/Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs index d93427c316c..4f9c679352f 100644 --- a/Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs +++ b/Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule.Tests { @@ -19,7 +18,7 @@ public void OnInputClicked(InputClickedEventData eventData) { // If we have a text to speech manager on the target object, say something. // This voice will appear to emanate from the object. - if (textToSpeech != null && eventData.PressType == InteractionSourcePressType.Select) + if (textToSpeech != null && eventData.PressType == InteractionSourcePressInfo.Select) { // Create message var msg = string.Format( diff --git a/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs b/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs index 2051dc2dd7d..4ae558a9f86 100644 --- a/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs +++ b/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs @@ -4,7 +4,10 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.XR; + +#if UNITY_WSA using UnityEngine.XR.WSA; +#endif namespace HoloToolkit.Unity.Boundary { @@ -73,7 +76,7 @@ private void SetBoundaryRendering() UnityEngine.Experimental.XR.Boundary.visible = renderBoundary; } } - +#if UNITY_WSA private void Awake() { // Render the floor based on if you are in editor or immersive device. @@ -193,5 +196,6 @@ public void CalculateBoundaryVolume() // Ensuring that we set height of the bounds volume to be say 10 feet tall. boundaryBounds.Encapsulate(new Vector3(0, boundaryHeight, 0)); } +#endif } } diff --git a/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs b/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs index 7962fff05f0..1103a2b6445 100644 --- a/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs +++ b/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs @@ -5,7 +5,10 @@ using System; using UnityEngine; using UnityEngine.XR; + +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +#endif namespace HoloToolkit.Unity.InputModule { @@ -73,12 +76,14 @@ private void Start() } } - void Update() + private void Update() { +#if UNITY_WSA if (InteractionManager.numSourceStates == 0) { HandleGamepad(); } +#endif if (currentPointingSource != null) { @@ -143,7 +148,7 @@ private void HandleGamepad() void IControllerInputHandler.OnInputPositionChanged(InputPositionEventData eventData) { - if (eventData.PressType == InteractionSourcePressType.Thumbstick) + if (eventData.PressType == InteractionSourcePressInfo.Thumbstick) { if (EnableTeleport) { diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputClickedEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputClickedEventData.cs index c07a95a39c4..7d8901d366d 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputClickedEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputClickedEventData.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine.EventSystems; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -20,7 +19,7 @@ public InputClickedEventData(EventSystem eventSystem) : base(eventSystem) { } - public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressType pressType, int tapCount) + public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressInfo pressType, int tapCount) { Initialize(inputSource, sourceId, tag, pressType); TapCount = tapCount; diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputEventData.cs index 5e817e87850..2cf4c74d85c 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputEventData.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine.EventSystems; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -14,14 +13,14 @@ public class InputEventData : BaseInputEventData /// /// Button type that initiated the event. /// - public InteractionSourcePressType PressType { get; private set; } + public InteractionSourcePressInfo PressType { get; private set; } public InputEventData(EventSystem eventSystem) : base(eventSystem) { } - public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressType pressType) + public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressInfo pressType) { BaseInitialize(inputSource, sourceId, tag); PressType = pressType; } } -} \ No newline at end of file +} diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputPositionEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputPositionEventData.cs index 8ff60ef0199..1a4a671049f 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputPositionEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputPositionEventData.cs @@ -3,7 +3,6 @@ using UnityEngine; using UnityEngine.EventSystems; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -18,10 +17,10 @@ public InputPositionEventData(EventSystem eventSystem) : base(eventSystem) { } - public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressType pressType, Vector2 position) + public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressInfo pressType, Vector2 position) { Initialize(inputSource, sourceId, tag, pressType); Position = position; } } -} \ No newline at end of file +} diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs similarity index 89% rename from Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs rename to Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs index e1ab069b0cc..4bb77815494 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs @@ -13,7 +13,7 @@ namespace HoloToolkit.Unity.InputModule /// /// Describes an input event that involves keyword recognition. /// - public class SpeechKeywordRecognizedEventData : BaseInputEventData + public class SpeechEventData : BaseInputEventData { /// /// The time it took for the phrase to be uttered. @@ -30,19 +30,20 @@ public class SpeechKeywordRecognizedEventData : BaseInputEventData /// public string RecognizedText { get; private set; } -#if UNITY_EDITOR || UNITY_WSA + public SpeechEventData(EventSystem eventSystem) : base(eventSystem) { } + +#if UNITY_WSA || UNITY_STANDALONE_WIN + /// /// A measure of correct recognition certainty. /// public ConfidenceLevel Confidence { get; private set; } - + /// /// A semantic meaning of recognized phrase. /// public SemanticMeaning[] SemanticMeanings { get; private set; } - public SpeechKeywordRecognizedEventData(EventSystem eventSystem) : base(eventSystem) { } - public void Initialize(IInputSource inputSource, uint sourceId, object tag, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText) { BaseInitialize(inputSource, sourceId, tag); diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISpeechHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISpeechHandler.cs index 92dd5355350..039a700dccf 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISpeechHandler.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISpeechHandler.cs @@ -10,6 +10,6 @@ namespace HoloToolkit.Unity.InputModule /// public interface ISpeechHandler : IEventSystemHandler { - void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData); + void OnSpeechKeywordRecognized(SpeechEventData eventData); } } \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/InputManager.cs index 02e9b8b7d5a..1efb8835046 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputManager.cs @@ -9,8 +9,6 @@ using UnityEngine; using UnityEngine.EventSystems; -//TODO wrap XR.WSA namespace. -using UnityEngine.XR.WSA.Input; #if UNITY_WSA || UNITY_STANDALONE_WIN using UnityEngine.Windows.Speech; #endif @@ -56,7 +54,7 @@ public class InputManager : Singleton private GamePadEventData gamePadEventData; private XboxControllerEventData xboxControllerEventData; #if UNITY_WSA || UNITY_STANDALONE_WIN - private SpeechKeywordRecognizedEventData speechKeywordRecognizedEventData; + private SpeechEventData speechEventData; private DictationEventData dictationEventData; #endif @@ -221,7 +219,7 @@ private void InitializeEventDatas() gamePadEventData = new GamePadEventData(EventSystem.current); xboxControllerEventData = new XboxControllerEventData(EventSystem.current); #if UNITY_WSA || UNITY_STANDALONE_WIN - speechKeywordRecognizedEventData = new SpeechKeywordRecognizedEventData(EventSystem.current); + speechEventData = new SpeechEventData(EventSystem.current); dictationEventData = new DictationEventData(EventSystem.current); #endif } @@ -390,7 +388,7 @@ public void HandleEvent(BaseEventData eventData, ExecuteEvents.EventFunction< handler.OnInputClicked(casted); }; - public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSourcePressType pressType, int tapCount, object tag = null) + public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, int tapCount, object tag = null) { // Create input event sourceClickedEventData.Initialize(source, sourceId, tag, pressType, tapCount); @@ -408,7 +406,7 @@ public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSou handler.OnInputUp(casted); }; - public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourcePressType pressType, object tag = null) + public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object tag = null) { // Create input event inputEventData.Initialize(source, sourceId, tag, pressType); @@ -417,7 +415,7 @@ public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourceP HandleEvent(inputEventData, OnSourceUpEventHandler); // UI events - if (ShouldSendUnityUiEvents && (pressType == InteractionSourcePressType.Select)) + if (ShouldSendUnityUiEvents && pressType == InteractionSourcePressInfo.Select) { PointerInputEventData pointerInputEventData = FocusManager.Instance.BorrowPointerEventData(); pointerInputEventData.InputSource = source; @@ -435,7 +433,7 @@ public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourceP handler.OnInputDown(casted); }; - public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourcePressType pressType, object tag = null) + public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object tag = null) { // Create input event inputEventData.Initialize(source, sourceId, tag, pressType); @@ -444,7 +442,7 @@ public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourc HandleEvent(inputEventData, OnSourceDownEventHandler); // UI events - if (ShouldSendUnityUiEvents && (pressType == InteractionSourcePressType.Select)) + if (ShouldSendUnityUiEvents && pressType == InteractionSourcePressInfo.Select) { PointerInputEventData pointerInputEventData = FocusManager.Instance.BorrowPointerEventData(); pointerInputEventData.InputSource = source; @@ -723,7 +721,7 @@ public void RaiseNavigationCanceled(IInputSource source, uint sourceId, object t handler.OnInputPositionChanged(casted); }; - public void RaiseInputPositionChanged(IInputSource source, uint sourceId, InteractionSourcePressType pressType, Vector2 position, object tag = null) + public void RaiseInputPositionChanged(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, Vector2 position, object tag = null) { // Create input event inputPositionEventData.Initialize(source, sourceId, tag, pressType, position); @@ -758,7 +756,7 @@ public void RaiseSelectPressedAmountChanged(IInputSource source, uint sourceId, public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object tag = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressType.Touchpad); + inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressInfo.Touchpad); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnTouchpadTouchedEventHandler); @@ -774,7 +772,7 @@ public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object tag public void RaiseTouchpadReleased(IInputSource source, uint sourceId, object tag = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressType.Touchpad); + inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressInfo.Touchpad); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnTouchpadReleasedEventHandler); @@ -876,17 +874,17 @@ public void RaiseXboxInputUpdate(IInputSource source, uint sourceId, XboxControl private static readonly ExecuteEvents.EventFunction OnSpeechKeywordRecognizedEventHandler = delegate (ISpeechHandler handler, BaseEventData eventData) { - SpeechKeywordRecognizedEventData casted = ExecuteEvents.ValidateEventData(eventData); + SpeechEventData casted = ExecuteEvents.ValidateEventData(eventData); handler.OnSpeechKeywordRecognized(casted); }; public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string text, object tag = null) { // Create input event - speechKeywordRecognizedEventData.Initialize(source, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); + speechEventData.Initialize(source, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(speechKeywordRecognizedEventData, OnSpeechKeywordRecognizedEventHandler); + HandleEvent(speechEventData, OnSpeechKeywordRecognizedEventHandler); } private static readonly ExecuteEvents.EventFunction OnDictationHypothesisEventHandler = diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/BaseInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/BaseInputSource.cs index 67dc36add01..22e9414d2f6 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/BaseInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/BaseInputSource.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -18,7 +17,7 @@ public bool SupportsInputInfo(uint sourceId, SupportedInputInfo inputInfo) return ((GetSupportedInputInfo(sourceId) & inputInfo) == inputInfo); } - public abstract bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind); + public abstract bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind); public abstract bool TryGetPointerPosition(uint sourceId, out Vector3 position); diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs index 9d204a9aac2..fc76415afa0 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs @@ -2,7 +2,10 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; + +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +#endif namespace HoloToolkit.Unity.InputModule { @@ -53,7 +56,7 @@ public ButtonStates() public bool SupportsMenuButton; public bool SupportsGrasp; public bool RaiseEventsBasedOnVisibility; - public InteractionSourceKind SourceKind; + public InteractionSourceInfo SourceKind; public Vector3 ControllerPosition; public Quaternion ControllerRotation; @@ -74,7 +77,7 @@ public ButtonStates() /// private const float MaxClickDuration = 0.5f; - [SerializeField] + [SerializeField] [Tooltip("The total amount of input source movement that needs to happen to signal intent to start a manipulation. This is a distance, but not a distance in any one direction.")] private float manipulationStartMovementThreshold = 0.03f; @@ -112,11 +115,11 @@ public override SupportedInputInfo GetSupportedInputInfo(uint sourceId) return supportedInputInfo; } - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { Debug.Assert(sourceId == controllerId, "Controller data requested for a mismatched source ID."); - sourceKind = this.SourceKind; + sourceKind = SourceKind; return true; } @@ -402,12 +405,12 @@ private void UpdateControllerState(DebugInteractionSourceState source) private void SendControllerStateEvents(float time) { // TODO: Send other new input manager events relating to source updates. - +#if UNITY_WSA if (CurrentButtonStates.SelectButtonStateChanged) { if (CurrentButtonStates.IsSelectButtonDown) { - InputManager.Instance.RaiseSourceDown(this, controllerId, InteractionSourcePressType.Select); + InputManager.Instance.RaiseSourceDown(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Select); } // New up presses require sending different events depending on whether it's also a click, hold, or manipulation. else @@ -427,9 +430,9 @@ private void SendControllerStateEvents(float time) else { // We currently only support single taps in editor. - InputManager.Instance.RaiseInputClicked(this, controllerId, InteractionSourcePressType.Select, 1); + InputManager.Instance.RaiseInputClicked(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Select, 1); } - InputManager.Instance.RaiseSourceUp(this, controllerId, InteractionSourcePressType.Select); + InputManager.Instance.RaiseSourceUp(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Select); } } // If the select state hasn't changed, but it's down, that means it might @@ -468,11 +471,11 @@ private void SendControllerStateEvents(float time) { if (CurrentButtonStates.IsMenuButtonDown) { - InputManager.Instance.RaiseSourceDown(this, controllerId, InteractionSourcePressType.Menu); + InputManager.Instance.RaiseSourceDown(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Menu); } else { - InputManager.Instance.RaiseSourceUp(this, controllerId, InteractionSourcePressType.Menu); + InputManager.Instance.RaiseSourceUp(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Menu); } } @@ -480,17 +483,18 @@ private void SendControllerStateEvents(float time) { if (CurrentButtonStates.IsGrasped) { - InputManager.Instance.RaiseSourceDown(this, controllerId, InteractionSourcePressType.Grasp); + InputManager.Instance.RaiseSourceDown(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Grasp); } else { - InputManager.Instance.RaiseSourceUp(this, controllerId, InteractionSourcePressType.Grasp); + InputManager.Instance.RaiseSourceUp(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Grasp); } } +#endif } /// - /// Sends the events for hand visibility changes & controller connect/disocnnect. + /// Sends the events for hand visibility changes & controller connect/disconnect. /// private void SendControllerVisibilityEvents() { diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs index 8ec8ff80712..45e27653417 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -45,9 +44,9 @@ protected virtual void RefreshDevices() #region Base Input Source Methods - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceKind.Voice; + sourceKind = InteractionSourceInfo.Voice; return true; } diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs index 0fff06015f6..bcd01325d25 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs @@ -3,7 +3,10 @@ using System; using UnityEngine; + +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +#endif namespace HoloToolkit.Unity.InputModule { @@ -13,6 +16,7 @@ namespace HoloToolkit.Unity.InputModule /// Gamepad button A pressed maps to hold started, completed, canceled gesture. /// Gamepad button A pressed plus left joystick rotate maps to navigation gesture. /// + [Obsolete("Please use GamePadInputSource or XboxControllerInputSource")] public class GamepadInput : BaseInputSource { [Tooltip("Game pad button to press for air tap.")] @@ -60,7 +64,7 @@ protected override void Start() { inputManager = InputManager.Instance; } - + if (inputManager == null) { Debug.LogError("Ensure your scene has the InputManager prefab."); @@ -70,10 +74,12 @@ protected override void Start() private void Update() { +#if UNITY_WSA if (InteractionManager.numSourceStates > 0) { return; } +#endif HandleGamepadAPressed(); } @@ -83,7 +89,7 @@ private void HandleGamepadAPressed() // TODO: Should this handle Submit from Edit > ProjectSettings > Input ? if (Input.GetButtonDown(GamePadButtonA)) { - inputManager.RaiseSourceDown(this, GamePadId, InteractionSourcePressType.Select); + inputManager.RaiseSourceDown(this, GamePadId, InteractionSourcePressInfo.Select); isAPressed = true; navigationCompleted = false; currentGestureState = GestureState.APressed; @@ -150,7 +156,7 @@ private void HandleGamepadAReleased() { if (Input.GetButtonUp(GamePadButtonA)) { - inputManager.RaiseSourceUp(this, GamePadId, InteractionSourcePressType.Select); + inputManager.RaiseSourceUp(this, GamePadId, InteractionSourcePressInfo.Select); switch (currentGestureState) { @@ -176,7 +182,7 @@ private void HandleGamepadAReleased() default: CancelInvoke("HandleHoldStarted"); CancelInvoke("HandleHoldCompleted"); - inputManager.RaiseInputClicked(this, GamePadId, InteractionSourcePressType.Select, 1); + inputManager.RaiseInputClicked(this, GamePadId, InteractionSourcePressInfo.Select, 1); Reset(); break; } @@ -249,9 +255,9 @@ public override bool TryGetGripRotation(uint sourceId, out Quaternion rotation) return false; } - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceKind.Controller; + sourceKind = InteractionSourceInfo.Controller; return true; } diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs index 59ab6c53812..d397b525208 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -24,7 +23,7 @@ public interface IInputSource /// Input info type that we want to get information about. bool SupportsInputInfo(uint sourceId, SupportedInputInfo inputInfo); - bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind); + bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind); /// /// Returns the position of the input source, if available. diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs index df55843640f..1bcb65d2c3c 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using System.Collections.Generic; using UnityEngine; -#if UNITY_EDITOR || UNITY_WSA +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +using System.Collections.Generic; #endif namespace HoloToolkit.Unity.InputModule @@ -28,13 +28,14 @@ public enum RecognizerStartBehavior { AutoStart, ManualStart } [Tooltip("Set to true to use the use rails (guides) for the navigation gesture, as opposed to full 3D navigation.")] public bool UseRailsNavigation = false; -#if UNITY_EDITOR || UNITY_WSA +#if UNITY_WSA protected GestureRecognizer gestureRecognizer; protected GestureRecognizer navigationGestureRecognizer; #endif #region IInputSource Capabilities and SourceData +#if UNITY_WSA private struct SourceCapability { public bool IsSupported; @@ -143,13 +144,14 @@ public void ResetUpdatedBooleans() /// Dictionary linking each source ID to its data. /// private readonly Dictionary sourceIdToData = new Dictionary(4); - - #endregion +#endif + #endregion IInputSource Capabilities and SourceData #region MonoBehaviour Functions private void Awake() { +#if UNITY_WSA gestureRecognizer = new GestureRecognizer(); gestureRecognizer.Tapped += GestureRecognizer_Tapped; @@ -186,10 +188,12 @@ private void Awake() GestureSettings.NavigationY | GestureSettings.NavigationZ); } +#endif } protected virtual void OnDestroy() { +#if UNITY_WSA InteractionManager.InteractionSourceUpdated -= InteractionManager_InteractionSourceUpdated; InteractionManager.InteractionSourceReleased -= InteractionManager_InteractionSourceReleased; @@ -223,21 +227,23 @@ protected virtual void OnDestroy() navigationGestureRecognizer.Dispose(); } +#endif } protected override void OnEnableAfterStart() { base.OnEnableAfterStart(); +#if UNITY_WSA if (RecognizerStart == RecognizerStartBehavior.AutoStart) { StartGestureRecognizers(); } - foreach (InteractionSourceState iss in InteractionManager.GetCurrentReading()) + foreach (InteractionSourceState state in InteractionManager.GetCurrentReading()) { - GetOrAddSourceData(iss.source); - InputManager.Instance.RaiseSourceDetected(this, iss.source.id); + GetOrAddSourceData(state.source); + InputManager.Instance.RaiseSourceDetected(this, state.source.id); } InteractionManager.InteractionSourceUpdated += InteractionManager_InteractionSourceUpdated; @@ -247,12 +253,15 @@ protected override void OnEnableAfterStart() InteractionManager.InteractionSourceLost += InteractionManager_InteractionSourceLost; InteractionManager.InteractionSourceDetected += InteractionManager_InteractionSourceDetected; +#else + RecognizerStart = RecognizerStartBehavior.ManualStart; +#endif } protected override void OnDisableAfterStart() { StopGestureRecognizers(); - +#if UNITY_WSA InteractionManager.InteractionSourceUpdated -= InteractionManager_InteractionSourceUpdated; InteractionManager.InteractionSourceReleased -= InteractionManager_InteractionSourceReleased; @@ -267,6 +276,7 @@ protected override void OnDisableAfterStart() sourceIdToData.Remove(iss.source.id); InputManager.Instance.RaiseSourceLost(this, iss.source.id); } +#endif base.OnDisableAfterStart(); } @@ -275,7 +285,7 @@ protected override void OnDisableAfterStart() public void StartGestureRecognizers() { -#if UNITY_EDITOR || UNITY_WSA +#if UNITY_WSA if (gestureRecognizer != null) { gestureRecognizer.StartCapturingGestures(); @@ -290,7 +300,7 @@ public void StartGestureRecognizers() public void StopGestureRecognizers() { -#if UNITY_EDITOR || UNITY_WSA +#if UNITY_WSA if (gestureRecognizer != null) { gestureRecognizer.StopCapturingGestures(); @@ -307,8 +317,8 @@ public void StopGestureRecognizers() public override SupportedInputInfo GetSupportedInputInfo(uint sourceId) { - SupportedInputInfo retVal = SupportedInputInfo.None; - + var retVal = SupportedInputInfo.None; +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData)) { @@ -321,97 +331,98 @@ public override SupportedInputInfo GetSupportedInputInfo(uint sourceId) retVal |= GetSupportFlag(sourceData.Menu, SupportedInputInfo.Menu); retVal |= GetSupportFlag(sourceData.Grasp, SupportedInputInfo.Grasp); } - +#endif return retVal; } - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData)) { - sourceKind = sourceData.SourceKind; + sourceKind = (InteractionSourceInfo)sourceData.SourceKind; return true; } - else - { - sourceKind = default(InteractionSourceKind); - return false; - } +#endif + + sourceKind = default(InteractionSourceInfo); + return false; } public override bool TryGetPointerPosition(uint sourceId, out Vector3 position) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.PointerPosition, out position)) { return true; } - else - { - position = default(Vector3); - return false; - } +#endif + + position = default(Vector3); + return false; } public override bool TryGetPointerRotation(uint sourceId, out Quaternion rotation) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.PointerRotation, out rotation)) { return true; } - else - { - rotation = default(Quaternion); - return false; - } +#endif + + rotation = default(Quaternion); + return false; } public override bool TryGetPointingRay(uint sourceId, out Ray pointingRay) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.PointingRay, out pointingRay)) { return true; } - else - { - pointingRay = default(Ray); - return false; - } +#endif + + pointingRay = default(Ray); + return false; } public override bool TryGetGripPosition(uint sourceId, out Vector3 position) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.GripPosition, out position)) { return true; } - else - { - position = default(Vector3); - return false; - } +#endif + + position = default(Vector3); + return false; } public override bool TryGetGripRotation(uint sourceId, out Quaternion rotation) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.GripRotation, out rotation)) { return true; } - else - { - rotation = default(Quaternion); - return false; - } +#endif + + rotation = default(Quaternion); + return false; } public override bool TryGetThumbstick(uint sourceId, out bool thumbstickPressed, out Vector2 thumbstickPosition) { +#if UNITY_WSA SourceData sourceData; AxisButton2D thumbstick; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Thumbstick, out thumbstick)) @@ -420,16 +431,16 @@ public override bool TryGetThumbstick(uint sourceId, out bool thumbstickPressed, thumbstickPosition = thumbstick.Position; return true; } - else - { - thumbstickPressed = false; - thumbstickPosition = Vector2.zero; - return false; - } +#endif + + thumbstickPressed = false; + thumbstickPosition = Vector2.zero; + return false; } public override bool TryGetTouchpad(uint sourceId, out bool touchpadPressed, out bool touchpadTouched, out Vector2 touchpadPosition) { +#if UNITY_WSA SourceData sourceData; TouchpadData touchpad; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Touchpad, out touchpad)) @@ -439,17 +450,17 @@ public override bool TryGetTouchpad(uint sourceId, out bool touchpadPressed, out touchpadPosition = touchpad.AxisButton.Position; return true; } - else - { - touchpadPressed = false; - touchpadTouched = false; - touchpadPosition = Vector2.zero; - return false; - } +#endif + + touchpadPressed = false; + touchpadTouched = false; + touchpadPosition = Vector2.zero; + return false; } public override bool TryGetSelect(uint sourceId, out bool selectPressed, out double selectPressedAmount) { +#if UNITY_WSA SourceData sourceData; AxisButton1D select; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Select, out select)) @@ -458,42 +469,43 @@ public override bool TryGetSelect(uint sourceId, out bool selectPressed, out dou selectPressedAmount = select.PressedAmount; return true; } - else - { - selectPressed = false; - selectPressedAmount = 0; - return false; - } +#endif + + selectPressed = false; + selectPressedAmount = 0; + return false; } public override bool TryGetGrasp(uint sourceId, out bool graspPressed) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Grasp, out graspPressed)) { return true; } - else - { - graspPressed = false; - return false; - } +#endif + + graspPressed = false; + return false; } public override bool TryGetMenu(uint sourceId, out bool menuPressed) { + +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Menu, out menuPressed)) { return true; } - else - { - menuPressed = false; - return false; - } +#endif + + menuPressed = false; + return false; } +#if UNITY_WSA private bool TryGetReading(SourceCapability capability, out TReading reading) { if (capability.IsAvailable) @@ -503,18 +515,15 @@ private bool TryGetReading(SourceCapability capability, out reading = capability.CurrentReading; return true; } - else - { - reading = default(TReading); - return false; - } + reading = default(TReading); + return false; } private SupportedInputInfo GetSupportFlag(SourceCapability capability, SupportedInputInfo flagIfSupported) { return (capability.IsSupported ? flagIfSupported : SupportedInputInfo.None); } - +#endif #endregion public void StartHaptics(uint sourceId, float intensity) @@ -550,6 +559,7 @@ public void StopHaptics(uint sourceId) #endif } +#if UNITY_WSA #region InteractionManager Events private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdatedEventArgs args) @@ -572,12 +582,12 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate if (sourceData.ThumbstickPositionUpdated) { - InputManager.Instance.RaiseInputPositionChanged(this, sourceData.SourceId, InteractionSourcePressType.Thumbstick, sourceData.Thumbstick.CurrentReading.Position); + InputManager.Instance.RaiseInputPositionChanged(this, sourceData.SourceId, InteractionSourcePressInfo.Thumbstick, sourceData.Thumbstick.CurrentReading.Position); } if (sourceData.TouchpadPositionUpdated) { - InputManager.Instance.RaiseInputPositionChanged(this, sourceData.SourceId, InteractionSourcePressType.Touchpad, sourceData.Touchpad.CurrentReading.AxisButton.Position); + InputManager.Instance.RaiseInputPositionChanged(this, sourceData.SourceId, InteractionSourcePressInfo.Touchpad, sourceData.Touchpad.CurrentReading.AxisButton.Position); } if (sourceData.TouchpadTouchedUpdated) @@ -600,12 +610,12 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args) { - InputManager.Instance.RaiseSourceUp(this, args.state.source.id, args.pressType); + InputManager.Instance.RaiseSourceUp(this, args.state.source.id, (InteractionSourcePressInfo)args.pressType); } private void InteractionManager_InteractionSourcePressed(InteractionSourcePressedEventArgs args) { - InputManager.Instance.RaiseSourceDown(this, args.state.source.id, args.pressType); + InputManager.Instance.RaiseSourceDown(this, args.state.source.id, (InteractionSourcePressInfo)args.pressType); } private void InteractionManager_InteractionSourceLost(InteractionSourceLostEventArgs args) @@ -757,12 +767,11 @@ private void UpdateSourceData(InteractionSourceState interactionSourceState, Sou #region Raise GestureRecognizer Events -#if UNITY_EDITOR || UNITY_WSA // TODO: robertes: Should these also cause source state data to be stored/updated? What about SourceDetected synthesized events? protected void GestureRecognizer_Tapped(TappedEventArgs obj) { - InputManager.Instance.RaiseInputClicked(this, obj.source.id, InteractionSourcePressType.Select, obj.tapCount); + InputManager.Instance.RaiseInputClicked(this, obj.source.id, InteractionSourcePressInfo.Select, obj.tapCount); } protected void GestureRecognizer_HoldStarted(HoldStartedEventArgs obj) @@ -820,8 +829,8 @@ protected void NavigationGestureRecognizer_NavigationCanceled(NavigationCanceled InputManager.Instance.RaiseNavigationCanceled(this, obj.source.id); } + #endregion //Raise GestureRecognizer Events #endif - #endregion } } \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs b/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs index 66453d3b1bf..6d337a87f4a 100644 --- a/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs @@ -7,7 +7,6 @@ #if UNITY_WSA || UNITY_STANDALONE_WIN using System.Text; using UnityEngine.Windows.Speech; -using UnityEngine.XR.WSA.Input; #endif namespace HoloToolkit.Unity.InputModule @@ -255,9 +254,9 @@ private static void DictationRecognizer_DictationError(string error, int hresult #region IInputSource Implementation - public bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceKind.Voice; + sourceKind = InteractionSourceInfo.Voice; return true; } diff --git a/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs b/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs index e1ded189fe6..d74db506533 100644 --- a/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs +++ b/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs @@ -3,7 +3,6 @@ using System; using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -38,7 +37,7 @@ void IInputHandler.OnInputDown(InputEventData eventData) void IInputHandler.OnInputUp(InputEventData eventData) { - if (IsEnabled && (eventData.PressType == InteractionSourcePressType.Select)) + if (IsEnabled && eventData.PressType == InteractionSourcePressInfo.Select) { ButtonPressed.RaiseEvent(); eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers. diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs new file mode 100644 index 00000000000..2ad20135078 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace HoloToolkit.Unity.InputModule +{ + public enum InteractionSourceInfo + { + Other = 0, + Hand = 1, + Voice = 2, + Controller = 3, + } +} diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta new file mode 100644 index 00000000000..bda03797482 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ac325f352d92177438eec1186406a398 +timeCreated: 1506471834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs new file mode 100644 index 00000000000..9c0c40174f9 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace HoloToolkit.Unity.InputModule +{ + public enum InteractionSourcePressInfo + { + None = 0, + Select = 1, + Menu = 2, + Grasp = 3, + Touchpad = 4, + Thumbstick = 5, + } +} diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta new file mode 100644 index 00000000000..7453f186ec0 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 96ae32b2be3bb584c8e78cf777d5cbc6 +timeCreated: 1506472367 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs index a1ddf8ec8be..2a416b62d68 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs @@ -1,5 +1,8 @@ using UnityEngine; + +#if UNITY_WSA using UnityEngine.XR.WSA; +#endif namespace HoloToolkit.Unity.InputModule { @@ -52,24 +55,25 @@ public enum DisplayType private void Start() { - if (HolographicSettings.IsDisplayOpaque) - { - CurrentDisplayType = DisplayType.Opaque; - ApplySettingsForOpaqueDisplay(); - if (OnDisplayDetected != null) - { - OnDisplayDetected(DisplayType.Opaque); - } - } - else +#if UNITY_WSA + if (!HolographicSettings.IsDisplayOpaque) { CurrentDisplayType = DisplayType.Transparent; ApplySettingsForTransparentDisplay(); if (OnDisplayDetected != null) { OnDisplayDetected(DisplayType.Transparent); + return; ; } } +#endif + + CurrentDisplayType = DisplayType.Opaque; + ApplySettingsForOpaqueDisplay(); + if (OnDisplayDetected != null) + { + OnDisplayDetected(DisplayType.Opaque); + } } public void ApplySettingsForOpaqueDisplay() diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs b/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs index 897c4823961..e29cce9f360 100644 --- a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs +++ b/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs @@ -75,7 +75,7 @@ protected virtual void Start() } } - void ISpeechHandler.OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) + void ISpeechHandler.OnSpeechKeywordRecognized(SpeechEventData eventData) { UnityEvent keywordResponse; diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs b/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs index 2b0fcf49833..4263078b414 100644 --- a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs @@ -7,7 +7,6 @@ #if UNITY_WSA || UNITY_STANDALONE_WIN using UnityEngine.Windows.Speech; -using UnityEngine.XR.WSA.Input; #endif namespace HoloToolkit.Unity.InputModule @@ -49,7 +48,7 @@ public enum RecognizerStartBehavior { AutoStart, ManualStart } private KeywordRecognizer keywordRecognizer; - private SpeechKeywordRecognizedEventData speechKeywordRecognizedEventData; + private SpeechEventData speechEventData; #region Unity Methods @@ -60,7 +59,7 @@ protected override void Start() DontDestroyOnLoad(gameObject); } - speechKeywordRecognizedEventData = new SpeechKeywordRecognizedEventData(EventSystem.current); + speechEventData = new SpeechEventData(EventSystem.current); int keywordCount = Keywords.Length; if (keywordCount > 0) @@ -167,7 +166,7 @@ public void StopKeywordRecognizer() private static readonly ExecuteEvents.EventFunction OnSpeechKeywordRecognizedEventHandler = delegate (ISpeechHandler handler, BaseEventData eventData) { - SpeechKeywordRecognizedEventData casted = ExecuteEvents.ValidateEventData(eventData); + SpeechEventData casted = ExecuteEvents.ValidateEventData(eventData); handler.OnSpeechKeywordRecognized(casted); }; @@ -177,19 +176,19 @@ protected void OnPhraseRecognized(ConfidenceLevel confidence, TimeSpan phraseDur object tag = null; // Create input event - speechKeywordRecognizedEventData.Initialize(this, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); + speechEventData.Initialize(this, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); // Pass handler through HandleEvent to perform modal/fallback logic - InputManager.Instance.HandleEvent(speechKeywordRecognizedEventData, OnSpeechKeywordRecognizedEventHandler); + InputManager.Instance.HandleEvent(speechEventData, OnSpeechKeywordRecognizedEventHandler); } #endif #region Base Input Source Methods - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceKind.Voice; + sourceKind = InteractionSourceInfo.Voice; return true; } diff --git a/Assets/HoloToolkit/SharingWithUNET/Scripts/PlayerController.cs b/Assets/HoloToolkit/SharingWithUNET/Scripts/PlayerController.cs index 0a8ea6302ac..cc89e52139c 100644 --- a/Assets/HoloToolkit/SharingWithUNET/Scripts/PlayerController.cs +++ b/Assets/HoloToolkit/SharingWithUNET/Scripts/PlayerController.cs @@ -32,6 +32,8 @@ public static PlayerController Instance /// public GameObject bullet; + public bool CanShareAnchors; + /// /// The transform of the shared world anchor. /// @@ -276,9 +278,11 @@ private void InitializeLocalPlayer() Debug.LogFormat("Set local player name {0} ip {1}", networkDiscovery.broadcastData, networkDiscovery.LocalIp); CmdSetPlayerName(networkDiscovery.broadcastData); CmdSetPlayerIp(networkDiscovery.LocalIp); - bool opaqueDisplay = UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque; - Debug.LogFormat("local player {0} share anchors ", (opaqueDisplay ? "does not" : "does")); - CmdSetCanShareAnchors(!opaqueDisplay); +#if UNITY_WSA + CanShareAnchors = !UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque; +#endif + Debug.LogFormat("local player {0} share anchors ", (CanShareAnchors ? "does not" : "does")); + CmdSetCanShareAnchors(CanShareAnchors); } } diff --git a/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs b/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs index 06a2af674fc..6b51c10f751 100644 --- a/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs +++ b/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs @@ -1,20 +1,19 @@ -using HoloToolkit.Unity.InputModule; -using UnityEngine; +using UnityEngine; using UnityEngine.Networking; +using HoloToolkit.Unity.InputModule; using HoloToolkit.Unity.SpatialMapping; namespace HoloToolkit.Unity.SharingWithUNET { public class UNetSharedHologram : NetworkBehaviour, IInputClickHandler { - /// /// The position relative to the shared world anchor. /// [SyncVar(hook = "xformchange")] private Vector3 localPosition; - void xformchange(Vector3 update) + private void xformchange(Vector3 update) { Debug.Log(localPosition + " xform change " + update); localPosition = update; @@ -41,16 +40,18 @@ public void CmdTransform(Vector3 postion, Quaternion rotation) } } - bool Moving = false; - int layerMask; - InputManager inputManager; + private bool Moving = false; + private int layerMask; + private InputManager inputManager; public Vector3 movementOffset = Vector3.zero; - bool isOpaque; + private bool isOpaque; // Use this for initialization - void Start() + private void Start() { +#if UNITY_WSA isOpaque = UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque; +#endif transform.SetParent(SharedCollection.Instance.transform, true); if (isServer) { @@ -64,7 +65,7 @@ void Start() } // Update is called once per frame - void Update() + private void Update() { if (Moving) @@ -79,7 +80,7 @@ void Update() } } - Vector3 ProposeTransformPosition() + private Vector3 ProposeTransformPosition() { // Put the model 3m in front of the user. Vector3 retval = Camera.main.transform.position + Camera.main.transform.forward * 3 + movementOffset; diff --git a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/ScrollingSessionListUIController.cs b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/ScrollingSessionListUIController.cs index 490adc72c16..eccd2f3d90a 100644 --- a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/ScrollingSessionListUIController.cs +++ b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/ScrollingSessionListUIController.cs @@ -4,7 +4,6 @@ using UnityEngine; using System; using System.Linq; -using HoloToolkit.Unity; namespace HoloToolkit.Unity.SharingWithUNET { @@ -26,7 +25,7 @@ public class ScrollingSessionListUIController : SingleInstance /// Keeps track of the current index that is the 'top' of the UI list - /// to enable scolling. + /// to enable scrolling. /// private int SessionIndex = 0; @@ -43,10 +42,12 @@ public class ScrollingSessionListUIController : SingleInstance().TagalongDistance = 1; } +#endif // Register for events when sessions are found / joined. networkDiscovery = NetworkDiscoveryWithAnchors.Instance; @@ -100,7 +101,7 @@ void SetChildren(bool Enabled) /// /// Updates which session is the 'top' session in the list, and sets the - /// session buttons accordinglingly + /// session buttons accordingly /// /// are we scrolling up, down, or not scrolling public void ScrollSessions(int Direction) diff --git a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs index fdc0ddade5b..fda068a8364 100644 --- a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs +++ b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs @@ -19,7 +19,7 @@ public class StartSessionButton : MonoBehaviour, IInputClickHandler void Start() { networkDiscovery = NetworkDiscoveryWithAnchors.Instance; -#if !UNITY_EDITOR +#if UNITY_WSA if (UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) { Debug.Log("Only hololens can host for now"); @@ -39,7 +39,7 @@ public void OnInputClicked(InputClickedEventData eventData) // Only let hololens host // We are also allowing the editor to host for testing purposes, but shared anchors // will currently not work in this mode. -#if !UNITY_EDITOR +#if UNITY_WSA if (!UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) #else Debug.Log("Unity editor can host, but World Anchors will not be shared"); diff --git a/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs b/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs index 25570d503a9..9d9c692625c 100644 --- a/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs +++ b/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs @@ -4,7 +4,10 @@ using System; using System.Collections.Generic; using UnityEngine; + +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +#endif namespace HoloToolkit.Unity { @@ -12,7 +15,9 @@ public class DebugPanelControllerInfo : MonoBehaviour { private class ControllerState { +#if UNITY_WSA public InteractionSourceHandedness Handedness; +#endif public Vector3 PointerPosition; public Quaternion PointerRotation; public Vector3 GripPosition; @@ -78,6 +83,7 @@ private void Start() } } +#if UNITY_WSA private void InteractionManager_InteractionSourceDetected(InteractionSourceDetectedEventArgs obj) { Debug.LogFormat("{0} {1} Detected", obj.state.source.handedness, obj.state.source.kind); @@ -116,10 +122,12 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate controllerState.TouchpadPosition = obj.state.touchpadPosition; } } +#endif private string GetControllerInfo() { string toReturn = ""; +#if UNITY_WSA foreach (ControllerState controllerState in controllers.Values) { // Debug message @@ -135,7 +143,7 @@ private string GetControllerInfo() controllerState.TouchpadTouched, controllerState.TouchpadPosition); // Text label display - if(controllerState.Handedness.Equals(InteractionSourceHandedness.Left)) + if (controllerState.Handedness.Equals(InteractionSourceHandedness.Left)) { LeftInfoTextPointerPosition.text = controllerState.Handedness.ToString(); LeftInfoTextPointerRotation.text = controllerState.PointerRotation.ToString(); @@ -168,6 +176,7 @@ private string GetControllerInfo() RightInfoTextTouchpadPosition.text = controllerState.TouchpadPosition.ToString(); } } +#endif return toReturn.Substring(0, Math.Max(0, toReturn.Length - 2)); } } diff --git a/Assets/HoloToolkit/Utilities/Scripts/HeadsetAdjustment.cs b/Assets/HoloToolkit/Utilities/Scripts/HeadsetAdjustment.cs index 57e597d0348..8e209815115 100644 --- a/Assets/HoloToolkit/Utilities/Scripts/HeadsetAdjustment.cs +++ b/Assets/HoloToolkit/Utilities/Scripts/HeadsetAdjustment.cs @@ -21,7 +21,7 @@ public void OnInputClicked(InputClickedEventData eventData) GotoNextScene(); } - public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) + public void OnSpeechKeywordRecognized(SpeechEventData eventData) { GotoNextScene(); } From dab4570dea13e60c75e59d415872eb96b1e98a58 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 26 Sep 2017 20:04:03 -0700 Subject: [PATCH 03/25] removed extra semi colon. --- .../Input/Scripts/Utilities/MixedRealityCameraManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs index 2a416b62d68..f325690d4d1 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs @@ -63,7 +63,7 @@ private void Start() if (OnDisplayDetected != null) { OnDisplayDetected(DisplayType.Transparent); - return; ; + return; } } #endif @@ -99,4 +99,4 @@ private static void SetQuality(int level) QualitySettings.SetQualityLevel(level, false); } } -} \ No newline at end of file +} From 79e2049584137d41a530efed090083efd0646ab5 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 10:09:53 -0700 Subject: [PATCH 04/25] More updates to the InputManger. Upated tag reference to tags and made it an object array. --- .../HoloToolkit/Input/Scripts/InputManager.cs | 108 +++++++++--------- .../Scripts/InputSources/EditorInputSource.cs | 2 +- .../InputSources/GamePadInputSource.cs | 4 +- .../Scripts/InputSources/GamepadInput.cs | 2 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/InputManager.cs index 1efb8835046..601296b481a 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputManager.cs @@ -388,10 +388,10 @@ public void HandleEvent(BaseEventData eventData, ExecuteEvents.EventFunction< handler.OnInputClicked(casted); }; - public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, int tapCount, object tag = null) + public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, int tapCount, object[] tags = null) { // Create input event - sourceClickedEventData.Initialize(source, sourceId, tag, pressType, tapCount); + sourceClickedEventData.Initialize(source, sourceId, tags, pressType, tapCount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourceClickedEventData, OnInputClickedEventHandler); @@ -406,10 +406,10 @@ public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSou handler.OnInputUp(casted); }; - public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object tag = null) + public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object[] tags = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, pressType); + inputEventData.Initialize(source, sourceId, tags, pressType); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnSourceUpEventHandler); @@ -433,10 +433,10 @@ public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourceP handler.OnInputDown(casted); }; - public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object tag = null) + public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object[] tags = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, pressType); + inputEventData.Initialize(source, sourceId, tags, pressType); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnSourceDownEventHandler); @@ -470,7 +470,7 @@ public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourc handler.OnSourceDetected(casted); }; - public void RaiseSourceDetected(IInputSource source, uint sourceId, object tag = null) + public void RaiseSourceDetected(IInputSource source, uint sourceId, object[] tags = null) { // Manage list of detected sources bool alreadyDetected = false; @@ -490,7 +490,7 @@ public void RaiseSourceDetected(IInputSource source, uint sourceId, object tag = } // Create input event - sourceStateEventData.Initialize(source, sourceId, tag); + sourceStateEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourceStateEventData, OnSourceDetectedEventHandler); @@ -503,7 +503,7 @@ public void RaiseSourceDetected(IInputSource source, uint sourceId, object tag = handler.OnSourceLost(casted); }; - public void RaiseSourceLost(IInputSource source, uint sourceId, object tag = null) + public void RaiseSourceLost(IInputSource source, uint sourceId, object[] tags = null) { // Manage list of detected sources for (int iDetected = 0; iDetected < detectedInputSources.Count; iDetected++) @@ -516,7 +516,7 @@ public void RaiseSourceLost(IInputSource source, uint sourceId, object tag = nul } // Create input event - sourceStateEventData.Initialize(source, sourceId, tag); + sourceStateEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourceStateEventData, OnSourceLostEventHandler); @@ -533,10 +533,10 @@ public void RaiseSourceLost(IInputSource source, uint sourceId, object tag = nul handler.OnManipulationStarted(casted); }; - public void RaiseManipulationStarted(IInputSource source, uint sourceId, object tag = null) + public void RaiseManipulationStarted(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - manipulationEventData.Initialize(source, sourceId, tag, Vector3.zero); + manipulationEventData.Initialize(source, sourceId, tags, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationStartedEventHandler); @@ -549,10 +549,10 @@ public void RaiseManipulationStarted(IInputSource source, uint sourceId, object handler.OnManipulationUpdated(casted); }; - public void RaiseManipulationUpdated(IInputSource source, uint sourceId, Vector3 cumulativeDelta, object tag = null) + public void RaiseManipulationUpdated(IInputSource source, uint sourceId, Vector3 cumulativeDelta, object[] tags = null) { // Create input event - manipulationEventData.Initialize(source, sourceId, tag, cumulativeDelta); + manipulationEventData.Initialize(source, sourceId, tags, cumulativeDelta); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationUpdatedEventHandler); @@ -565,10 +565,10 @@ public void RaiseManipulationUpdated(IInputSource source, uint sourceId, Vector3 handler.OnManipulationCompleted(casted); }; - public void RaiseManipulationCompleted(IInputSource source, uint sourceId, Vector3 cumulativeDelta, object tag = null) + public void RaiseManipulationCompleted(IInputSource source, uint sourceId, Vector3 cumulativeDelta, object[] tags = null) { // Create input event - manipulationEventData.Initialize(source, sourceId, tag, cumulativeDelta); + manipulationEventData.Initialize(source, sourceId, tags, cumulativeDelta); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationCompletedEventHandler); @@ -581,10 +581,10 @@ public void RaiseManipulationCompleted(IInputSource source, uint sourceId, Vecto handler.OnManipulationCanceled(casted); }; - public void RaiseManipulationCanceled(IInputSource source, uint sourceId, object tag = null) + public void RaiseManipulationCanceled(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - manipulationEventData.Initialize(source, sourceId, tag, Vector3.zero); + manipulationEventData.Initialize(source, sourceId, tags, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationCanceledEventHandler); @@ -601,10 +601,10 @@ public void RaiseManipulationCanceled(IInputSource source, uint sourceId, object handler.OnHoldStarted(casted); }; - public void RaiseHoldStarted(IInputSource source, uint sourceId, object tag = null) + public void RaiseHoldStarted(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - holdEventData.Initialize(source, sourceId, tag); + holdEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(holdEventData, OnHoldStartedEventHandler); @@ -617,10 +617,10 @@ public void RaiseHoldStarted(IInputSource source, uint sourceId, object tag = nu handler.OnHoldCompleted(casted); }; - public void RaiseHoldCompleted(IInputSource source, uint sourceId, object tag = null) + public void RaiseHoldCompleted(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - holdEventData.Initialize(source, sourceId, tag); + holdEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(holdEventData, OnHoldCompletedEventHandler); @@ -633,10 +633,10 @@ public void RaiseHoldCompleted(IInputSource source, uint sourceId, object tag = handler.OnHoldCanceled(casted); }; - public void RaiseHoldCanceled(IInputSource source, uint sourceId, object tag = null) + public void RaiseHoldCanceled(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - holdEventData.Initialize(source, sourceId, tag); + holdEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(holdEventData, OnHoldCanceledEventHandler); @@ -653,10 +653,10 @@ public void RaiseHoldCanceled(IInputSource source, uint sourceId, object tag = n handler.OnNavigationStarted(casted); }; - public void RaiseNavigationStarted(IInputSource source, uint sourceId, object tag = null) + public void RaiseNavigationStarted(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - navigationEventData.Initialize(source, sourceId, tag, Vector3.zero); + navigationEventData.Initialize(source, sourceId, tags, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationStartedEventHandler); @@ -669,10 +669,10 @@ public void RaiseNavigationStarted(IInputSource source, uint sourceId, object ta handler.OnNavigationUpdated(casted); }; - public void RaiseNavigationUpdated(IInputSource source, uint sourceId, Vector3 normalizedOffset, object tag = null) + public void RaiseNavigationUpdated(IInputSource source, uint sourceId, Vector3 normalizedOffset, object[] tags = null) { // Create input event - navigationEventData.Initialize(source, sourceId, tag, normalizedOffset); + navigationEventData.Initialize(source, sourceId, tags, normalizedOffset); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationUpdatedEventHandler); @@ -685,10 +685,10 @@ public void RaiseNavigationUpdated(IInputSource source, uint sourceId, Vector3 n handler.OnNavigationCompleted(casted); }; - public void RaiseNavigationCompleted(IInputSource source, uint sourceId, Vector3 normalizedOffset, object tag = null) + public void RaiseNavigationCompleted(IInputSource source, uint sourceId, Vector3 normalizedOffset, object[] tags = null) { // Create input event - navigationEventData.Initialize(source, sourceId, tag, normalizedOffset); + navigationEventData.Initialize(source, sourceId, tags, normalizedOffset); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationCompletedEventHandler); @@ -701,10 +701,10 @@ public void RaiseNavigationCompleted(IInputSource source, uint sourceId, Vector3 handler.OnNavigationCanceled(casted); }; - public void RaiseNavigationCanceled(IInputSource source, uint sourceId, object tag = null) + public void RaiseNavigationCanceled(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - navigationEventData.Initialize(source, sourceId, tag, Vector3.zero); + navigationEventData.Initialize(source, sourceId, tags, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationCanceledEventHandler); @@ -721,10 +721,10 @@ public void RaiseNavigationCanceled(IInputSource source, uint sourceId, object t handler.OnInputPositionChanged(casted); }; - public void RaiseInputPositionChanged(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, Vector2 position, object tag = null) + public void RaiseInputPositionChanged(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, Vector2 position, object[] tags = null) { // Create input event - inputPositionEventData.Initialize(source, sourceId, tag, pressType, position); + inputPositionEventData.Initialize(source, sourceId, tags, pressType, position); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPositionEventData, OnInputPositionChangedEventHandler); @@ -737,10 +737,10 @@ public void RaiseInputPositionChanged(IInputSource source, uint sourceId, Intera handler.OnSelectPressedAmountChanged(casted); }; - public void RaiseSelectPressedAmountChanged(IInputSource source, uint sourceId, double pressedAmount, object tag = null) + public void RaiseSelectPressedAmountChanged(IInputSource source, uint sourceId, double pressedAmount, object[] tags = null) { // Create input event - selectPressedEventData.Initialize(source, sourceId, tag, pressedAmount); + selectPressedEventData.Initialize(source, sourceId, tags, pressedAmount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(selectPressedEventData, OnSelectPressedAmountChangedEventHandler); @@ -753,10 +753,10 @@ public void RaiseSelectPressedAmountChanged(IInputSource source, uint sourceId, handler.OnTouchpadTouched(casted); }; - public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object tag = null) + public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressInfo.Touchpad); + inputEventData.Initialize(source, sourceId, tags, InteractionSourcePressInfo.Touchpad); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnTouchpadTouchedEventHandler); @@ -769,10 +769,10 @@ public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object tag handler.OnTouchpadReleased(casted); }; - public void RaiseTouchpadReleased(IInputSource source, uint sourceId, object tag = null) + public void RaiseTouchpadReleased(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressInfo.Touchpad); + inputEventData.Initialize(source, sourceId, tags, InteractionSourcePressInfo.Touchpad); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnTouchpadReleasedEventHandler); @@ -785,10 +785,10 @@ public void RaiseTouchpadReleased(IInputSource source, uint sourceId, object tag handler.OnPositionChanged(casted); }; - public void RaiseSourcePositionChanged(IInputSource source, uint sourceId, Vector3 pointerPosition, Vector3 gripPosition, object tag = null) + public void RaiseSourcePositionChanged(IInputSource source, uint sourceId, Vector3 pointerPosition, Vector3 gripPosition, object[] tags = null) { // Create input event - sourcePositionEventData.Initialize(source, sourceId, tag, pointerPosition, gripPosition); + sourcePositionEventData.Initialize(source, sourceId, tags, pointerPosition, gripPosition); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourcePositionEventData, OnSourcePositionChangedEventHandler); @@ -801,10 +801,10 @@ public void RaiseSourcePositionChanged(IInputSource source, uint sourceId, Vecto handler.OnRotationChanged(casted); }; - public void RaiseSourceRotationChanged(IInputSource source, uint sourceId, Quaternion pointerRotation, Quaternion gripRotation, object tag = null) + public void RaiseSourceRotationChanged(IInputSource source, uint sourceId, Quaternion pointerRotation, Quaternion gripRotation, object[] tags = null) { // Create input event - sourceRotationEventData.Initialize(source, sourceId, tag, pointerRotation, gripRotation); + sourceRotationEventData.Initialize(source, sourceId, tags, pointerRotation, gripRotation); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourceRotationEventData, OnSourceRotationChangedEventHandler); @@ -878,10 +878,10 @@ public void RaiseXboxInputUpdate(IInputSource source, uint sourceId, XboxControl handler.OnSpeechKeywordRecognized(casted); }; - public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string text, object tag = null) + public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string text, object[] tags = null) { // Create input event - speechEventData.Initialize(source, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); + speechEventData.Initialize(source, sourceId, tags, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(speechEventData, OnSpeechKeywordRecognizedEventHandler); @@ -894,10 +894,10 @@ public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceI handler.OnDictationHypothesis(casted); }; - public void RaiseDictationHypothesis(IInputSource source, uint sourceId, string dictationHypothesis, AudioClip dictationAudioClip = null, object tag = null) + public void RaiseDictationHypothesis(IInputSource source, uint sourceId, string dictationHypothesis, AudioClip dictationAudioClip = null, object[] tags = null) { // Create input event - dictationEventData.Initialize(source, sourceId, tag, dictationHypothesis, dictationAudioClip); + dictationEventData.Initialize(source, sourceId, tags, dictationHypothesis, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationHypothesisEventHandler); @@ -910,10 +910,10 @@ public void RaiseDictationHypothesis(IInputSource source, uint sourceId, string handler.OnDictationResult(casted); }; - public void RaiseDictationResult(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip = null, object tag = null) + public void RaiseDictationResult(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null) { // Create input event - dictationEventData.Initialize(source, sourceId, tag, dictationResult, dictationAudioClip); + dictationEventData.Initialize(source, sourceId, tags, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationResultEventHandler); @@ -926,10 +926,10 @@ public void RaiseDictationResult(IInputSource source, uint sourceId, string dict handler.OnDictationComplete(casted); }; - public void RaiseDictationComplete(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip, object tag = null) + public void RaiseDictationComplete(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip, object[] tags = null) { // Create input event - dictationEventData.Initialize(source, sourceId, tag, dictationResult, dictationAudioClip); + dictationEventData.Initialize(source, sourceId, tags, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationCompleteEventHandler); @@ -942,10 +942,10 @@ public void RaiseDictationComplete(IInputSource source, uint sourceId, string di handler.OnDictationError(casted); }; - public void RaiseDictationError(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip = null, object tag = null) + public void RaiseDictationError(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null) { // Create input event - dictationEventData.Initialize(source, sourceId, tag, dictationResult, dictationAudioClip); + dictationEventData.Initialize(source, sourceId, tags, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationErrorEventHandler); diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs index fc76415afa0..d3110a66e83 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs @@ -451,7 +451,7 @@ private void SendControllerStateEvents(float time) CurrentButtonStates.HoldInProgress = false; } - InputManager.Instance.RaiseManipulationStarted(this, controllerId, CurrentButtonStates.CumulativeDelta); + InputManager.Instance.RaiseManipulationStarted(this, controllerId); CurrentButtonStates.ManipulationInProgress = true; } // Holds are triggered by time. diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs index 45e27653417..8ace308887a 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs @@ -8,7 +8,7 @@ namespace HoloToolkit.Unity.InputModule public class GamePadInputSource : BaseInputSource { [SerializeField] - [Tooltip("Time in secords to determine if an Input Device has been connected or disconnected")] + [Tooltip("Time in seconds to determine if an Input Device has been connected or disconnected")] protected float DeviceRefreshInterval = 3.0f; protected float DeviceRefreshTimer; protected int LastDeviceUpdateCount; @@ -46,7 +46,7 @@ protected virtual void RefreshDevices() public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceInfo.Voice; + sourceKind = InteractionSourceInfo.Controller; return true; } diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs index bcd01325d25..46b93b78905 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs @@ -144,7 +144,7 @@ private void HandleNavigation() currentGestureState = GestureState.NavigationStarted; navigationStarted = true; // Raise navigation started event. - inputManager.RaiseNavigationStarted(this, GamePadId, normalizedOffset); + inputManager.RaiseNavigationStarted(this, GamePadId); } // Raise navigation updated event. From 896893dfa9a0910aa54b08d668af60696efa7ff8 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 12:10:13 -0700 Subject: [PATCH 05/25] Input/Scripts folder organization --- .../Scripts/GameControllerManipulator.cs | 166 ------------------ .../Scripts/GameControllerManipulator.cs.meta | 12 -- .../Input/Scripts/InputEvents.meta | 10 -- .../IControllerInputHandler.cs | 0 .../IControllerInputHandler.cs.meta | 0 .../IControllerTouchpadHandler.cs | 0 .../IControllerTouchpadHandler.cs.meta | 0 .../IPointerSpecificFocusable.cs | 0 .../IPointerSpecificFocusable.cs.meta | 0 .../ISelectHandler.cs | 0 .../ISelectHandler.cs.meta | 0 .../ISourcePositionHandler.cs | 0 .../ISourcePositionHandler.cs.meta | 0 .../ISourceRotationHandler.cs | 0 .../ISourceRotationHandler.cs.meta | 0 .../SpeechInputSource.cs | 0 .../SpeechInputSource.cs.meta | 0 .../Scripts/{ => Utilities}/ControllerInfo.cs | 0 .../{ => Utilities}/ControllerInfo.cs.meta | 0 .../{ => Utilities}/ControllerVisualizer.cs | 0 .../ControllerVisualizer.cs.meta | 0 .../{ => Utilities}/EditorInputSelector.cs | 0 .../EditorInputSelector.cs.meta | 0 .../Scripts/{ => Utilities}/InputManager.cs | 0 .../{ => Utilities}/InputManager.cs.meta | 0 .../{ => Utilities}/KeyboardManager.cs | 0 .../{ => Utilities}/KeyboardManager.cs.meta | 0 .../{Voice => Utilities}/KeywordAndKeyCode.cs | 0 .../KeywordAndKeyCode.cs.meta | 0 .../{Voice => Utilities}/KeywordManager.cs | 0 .../KeywordManager.cs.meta | 0 .../MixedRealityTeleport.cs | 0 .../MixedRealityTeleport.cs.meta | 0 .../SpeechInputHandler.cs | 0 .../SpeechInputHandler.cs.meta | 0 Assets/HoloToolkit/Input/Scripts/Voice.meta | 9 - 36 files changed, 197 deletions(-) delete mode 100644 Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs delete mode 100644 Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs.meta delete mode 100644 Assets/HoloToolkit/Input/Scripts/InputEvents.meta rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IControllerInputHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IControllerInputHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IControllerTouchpadHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IControllerTouchpadHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IPointerSpecificFocusable.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IPointerSpecificFocusable.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISelectHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISelectHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISourcePositionHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISourcePositionHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISourceRotationHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISourceRotationHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => InputSources}/SpeechInputSource.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => InputSources}/SpeechInputSource.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/ControllerInfo.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/ControllerInfo.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/ControllerVisualizer.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/ControllerVisualizer.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/EditorInputSelector.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/EditorInputSelector.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/InputManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/InputManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/KeyboardManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/KeyboardManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/KeywordAndKeyCode.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/KeywordAndKeyCode.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/KeywordManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/KeywordManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Gaze => Utilities}/MixedRealityTeleport.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Gaze => Utilities}/MixedRealityTeleport.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/SpeechInputHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/SpeechInputHandler.cs.meta (100%) delete mode 100644 Assets/HoloToolkit/Input/Scripts/Voice.meta diff --git a/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs b/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs deleted file mode 100644 index 4c450119d05..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using UnityEngine; - -namespace HoloToolkit.Unity.InputModule -{ - /// - /// Allows the user to place and rotate GameObjects using a game controller. - /// For a more complete gamepad control script refer to GamepadInput.cs and MixedRealityTeleport.cs - /// - /// Make sure to enable the capability on HoloLens Platform ONLY. Enabling this capability on the PC or Xbox targets will break input. - [Obsolete("Please use XboxControllerInputSource")] - public class GameControllerManipulator : MonoBehaviour - { - [Tooltip("Name of the joystick axis that moves the object along X as set in InputManager")] - public string MoveXAxisName = "ControllerLeftStickX"; - [Tooltip("Speed of movement along X")] - public float MoveXAxisSpeed = 0.2f; - - [Tooltip("Name of the joystick axis that moves the object along Y as set in InputManager")] - public string MoveYAxisName = "ControllerLeftStickY"; - [Tooltip("Speed of movement along Y")] - public float MoveYAxisSpeed = 0.2f; - - [Tooltip("Name of the joystick axis that moves the object along Z as set in InputManager")] - public string MoveZAxisName = "ControllerTriggerAxis"; - [Tooltip("Speed of movement along Z")] - public float MoveZAxisSpeed = 0.2f; - - [Tooltip("Name of the button the user presses to move the object with gaze")] - public string MoveWithGazeButtonName = "Fire1"; - - [Tooltip("Name of the joystick axis that rotates around X as set in InputManager")] - public string RotateAroundXAxisName = "ControllerLeftStickY"; - [Tooltip("Speed of rotation around X")] - public float RotateAroundXAxisSpeed = -1f; - - [Tooltip("Name of the joystick axis that rotates around Y as set in InputManager")] - public string RotateAroundYAxisName = "ControllerLeftStickX"; - [Tooltip("Speed of rotation around Y")] - public float RotateAroundYAxisSpeed = -1f; - - [Tooltip("Name of the joystick axis that rotates around Z as set in InputManager")] - public string RotateAroundZAxisName = ""; - [Tooltip("Speed of rotation around Z")] - public float RotateAroundZAxisSpeed = 1f; - - [Tooltip("Name of the button used to enable rotation. Useful for single stick controllers")] - public string RotateModifierButtonName = "Fire2"; - - [Tooltip("Move the gaze target instead of the GameObject this script is attached to")] - public bool MoveGazeTarget = false; - - private GameObject lastAffectedObject; - private float stickDistance = 0; - - // Update is called once per frame - private void Update() - { - GameObject objectToManipulate; - - if (!MoveGazeTarget) - { - objectToManipulate = gameObject; - } - else - { - objectToManipulate = lastAffectedObject ?? GazeManager.Instance.HitObject; - } - - if (objectToManipulate == null) - { - return; - } - - var cameraTransform = CameraCache.Main.transform; - - //Rotate - var noRotateModifier = string.IsNullOrEmpty(RotateModifierButtonName); - var enableRotate = noRotateModifier || Input.GetButton(RotateModifierButtonName); - - float rz = 0; - float ry = 0; - float rx = 0; - - if (enableRotate) - { - rz = RotateAroundAxis(objectToManipulate, RotateAroundZAxisName, cameraTransform.forward, RotateAroundZAxisSpeed); - ry = RotateAroundAxis(objectToManipulate, RotateAroundYAxisName, cameraTransform.up, RotateAroundYAxisSpeed); - rx = RotateAroundAxis(objectToManipulate, RotateAroundXAxisName, cameraTransform.right, RotateAroundXAxisSpeed); - } - - //Move - bool usingSameAxisForRotateAndMove = RotateAroundYAxisName == MoveXAxisName || - RotateAroundYAxisName == MoveZAxisName || - RotateAroundZAxisName == MoveXAxisName || - RotateAroundZAxisName == MoveYAxisName; - - float x = 0; - float y = 0; - - //only move if the movement axis has not been used for rotation - if (!(enableRotate && usingSameAxisForRotateAndMove)) - { - x = Input.GetAxis(MoveXAxisName) * MoveXAxisSpeed * 60 * Time.deltaTime; - objectToManipulate.transform.RotateAround(cameraTransform.position, cameraTransform.up, x); - - y = Input.GetAxis(MoveYAxisName) * MoveYAxisSpeed * 60 * Time.deltaTime; - objectToManipulate.transform.RotateAround(cameraTransform.position, cameraTransform.right, y); - } - - var z = Input.GetAxis(MoveZAxisName) * MoveZAxisSpeed * 60 * Time.deltaTime; - objectToManipulate.transform.position += cameraTransform.forward*z*-0.03f; - - var stickInFrontOfMe = Input.GetButton(MoveWithGazeButtonName); - - if (stickInFrontOfMe) - { - if (stickDistance == 0) - { - stickDistance = (objectToManipulate.transform.position - cameraTransform.position).magnitude; - } - - objectToManipulate.transform.position = cameraTransform.position + cameraTransform.forward * stickDistance; - } - else - { - stickDistance = 0; - } - - - if (stickInFrontOfMe || x != 0 || y != 0 || z != 0 || rz != 0 || ry != 0 || rx != 0) - { - lastAffectedObject = objectToManipulate; - } -#if !UNITY_EDITOR - else - { - lastAffectedObject = null; //easier to test in Unity this way - } -#endif - } - - /// - /// Rotates the specified GameObject as dictated by joystick values and multipliers - /// - /// the gameObject to rotate - /// the name of the joystick axis - /// vector to rotate around - /// rotation speed - /// the amount of rotation applied - private float RotateAroundAxis(GameObject objectToRotate, string joyAxisName, Vector3 vectorToRotateAround, float speed) - { - if (string.IsNullOrEmpty(joyAxisName)) - { - return 0; - } - - var result = Input.GetAxis(joyAxisName) * speed * 60 * Time.deltaTime; - objectToRotate.transform.rotation = Quaternion.Euler(vectorToRotateAround * result) * objectToRotate.transform.rotation; - return result; - } - } -} diff --git a/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs.meta b/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs.meta deleted file mode 100644 index 9b9eae5a900..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a4d43a912ea5ac9408a3e9d407d36b53 -timeCreated: 1472832956 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents.meta b/Assets/HoloToolkit/Input/Scripts/InputEvents.meta deleted file mode 100644 index 2fdd0cded33..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/InputEvents.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 9660420db2c085246ad4af96397bd31c -folderAsset: yes -timeCreated: 1470933856 -licenseType: Pro -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerInputHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerInputHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerInputHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerInputHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerInputHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerInputHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerInputHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerInputHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerTouchpadHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerTouchpadHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerTouchpadHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerTouchpadHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerTouchpadHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerTouchpadHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerTouchpadHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerTouchpadHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IPointerSpecificFocusable.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IPointerSpecificFocusable.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IPointerSpecificFocusable.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IPointerSpecificFocusable.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IPointerSpecificFocusable.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IPointerSpecificFocusable.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IPointerSpecificFocusable.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IPointerSpecificFocusable.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISelectHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISelectHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISelectHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISelectHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISelectHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISelectHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISelectHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISelectHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourcePositionHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourcePositionHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISourcePositionHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourcePositionHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourcePositionHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourcePositionHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISourcePositionHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourcePositionHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceRotationHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourceRotationHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceRotationHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourceRotationHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceRotationHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourceRotationHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceRotationHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourceRotationHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/SpeechInputSource.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/SpeechInputSource.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/SpeechInputSource.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/SpeechInputSource.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/ControllerInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/ControllerInfo.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs diff --git a/Assets/HoloToolkit/Input/Scripts/ControllerInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/ControllerInfo.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/ControllerVisualizer.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerVisualizer.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/ControllerVisualizer.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/ControllerVisualizer.cs diff --git a/Assets/HoloToolkit/Input/Scripts/ControllerVisualizer.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerVisualizer.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/ControllerVisualizer.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/ControllerVisualizer.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/EditorInputSelector.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/EditorInputSelector.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs diff --git a/Assets/HoloToolkit/Input/Scripts/EditorInputSelector.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/EditorInputSelector.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/KeyboardManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/KeyboardManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/KeyboardManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/KeyboardManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice.meta b/Assets/HoloToolkit/Input/Scripts/Voice.meta deleted file mode 100644 index d95dcd40385..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/Voice.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1e1644ee9122f0947bb1a04f2da54d79 -folderAsset: yes -timeCreated: 1464209698 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: From f12453f17366bc3e988f4f1cd18f3fdb99a13668 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 12:35:43 -0700 Subject: [PATCH 06/25] A bit more organization. Minor changes. --- .../DictationInputManager.cs | 0 .../DictationInputManager.cs.meta | 0 .../InputSources/IInputSourceInfoProvider.cs | 15 +++++++++++++++ .../InputSources/IInputSourceInfoProvider.cs.meta | 13 +++++++++++++ .../InputSourceInfo.cs | 15 +-------------- .../InputSourceInfo.cs.meta | 0 .../InteractionSourceInfo.cs | 0 .../InteractionSourceInfo.cs.meta | 0 .../InteractionSourcePressInfo.cs | 0 .../InteractionSourcePressInfo.cs.meta | 0 .../Scripts/{ => Utilities}/Interactions.meta | 0 .../{ => Interactions}/EditorInputControl.cs | 0 .../{ => Interactions}/EditorInputControl.cs.meta | 0 .../{ => Interactions}/EditorInputSelector.cs | 0 .../EditorInputSelector.cs.meta | 0 .../{ => Utilities}/Interactions/HandDraggable.cs | 0 .../Interactions/HandDraggable.cs.meta | 0 .../{ => Interactions}/ManualGazeControl.cs | 0 .../{ => Interactions}/ManualGazeControl.cs.meta | 0 .../{ => Interactions}/SpeechInputHandler.cs | 0 .../{ => Interactions}/SpeechInputHandler.cs.meta | 0 .../{ => Utilities}/Interactions/TapToPlace.cs | 0 .../Interactions/TapToPlace.cs.meta | 0 .../Interactions}/TriggerButton.cs | 0 .../Interactions}/TriggerButton.cs.meta | 0 .../Scripts/{UI.meta => Utilities/Managers.meta} | 5 +++-- .../Utilities/{ => Managers}/HandGuidance.cs | 0 .../Utilities/{ => Managers}/HandGuidance.cs.meta | 0 .../Utilities/{ => Managers}/InputManager.cs | 0 .../Utilities/{ => Managers}/InputManager.cs.meta | 0 .../Utilities/{ => Managers}/KeyboardManager.cs | 0 .../{ => Managers}/KeyboardManager.cs.meta | 0 .../Utilities/{ => Managers}/KeywordManager.cs | 0 .../{ => Managers}/KeywordManager.cs.meta | 0 .../{ => Managers}/MixedRealityCameraManager.cs | 0 .../MixedRealityCameraManager.cs.meta | 0 .../{ => Managers}/MixedRealityTeleport.cs | 0 .../{ => Managers}/MixedRealityTeleport.cs.meta | 0 .../Input/Scripts/Utilities/SetGlobalListener.cs | 2 -- .../Input/Scripts/{Microphone.meta => Voice.meta} | 0 .../{Utilities => Voice}/KeywordAndKeyCode.cs | 0 .../KeywordAndKeyCode.cs.meta | 0 .../Scripts/{Microphone => Voice}/MicStream.cs | 0 .../{Microphone => Voice}/MicStream.cs.meta | 0 44 files changed, 32 insertions(+), 18 deletions(-) rename Assets/HoloToolkit/Input/Scripts/{Microphone => InputSources}/DictationInputManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Microphone => InputSources}/DictationInputManager.cs.meta (100%) create mode 100644 Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs create mode 100644 Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs.meta rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InputSourceInfo.cs (75%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InputSourceInfo.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InteractionSourceInfo.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InteractionSourceInfo.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InteractionSourcePressInfo.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InteractionSourcePressInfo.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/EditorInputControl.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/EditorInputControl.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/EditorInputSelector.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/EditorInputSelector.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions/HandDraggable.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions/HandDraggable.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/ManualGazeControl.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/ManualGazeControl.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/SpeechInputHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/SpeechInputHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions/TapToPlace.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions/TapToPlace.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{UI => Utilities/Interactions}/TriggerButton.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{UI => Utilities/Interactions}/TriggerButton.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{UI.meta => Utilities/Managers.meta} (60%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/HandGuidance.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/HandGuidance.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/InputManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/InputManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/KeyboardManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/KeyboardManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/KeywordManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/KeywordManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/MixedRealityCameraManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/MixedRealityCameraManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/MixedRealityTeleport.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/MixedRealityTeleport.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Microphone.meta => Voice.meta} (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => Voice}/KeywordAndKeyCode.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => Voice}/KeywordAndKeyCode.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Microphone => Voice}/MicStream.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Microphone => Voice}/MicStream.cs.meta (100%) diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/DictationInputManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/DictationInputManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/DictationInputManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/DictationInputManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs new file mode 100644 index 00000000000..f064cdc2ba0 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace HoloToolkit.Unity.InputModule +{ + /// + /// IInputSourceInfoProvider gives you the input source like hands or motion controller. + /// It will also report the source id for that source. + /// + public interface IInputSourceInfoProvider + { + IInputSource InputSource { get; } + uint SourceId { get; } + } +} \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs.meta new file mode 100644 index 00000000000..a4c551db84c --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9dab31032be6bc94ba022d3ae2a69112 +timeCreated: 1506540750 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs similarity index 75% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs index 0417a694a0a..13f8a4988dd 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs @@ -1,16 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using System; - namespace HoloToolkit.Unity.InputModule { /// /// InputSourceInfo gives you the input source like hands or motion controller. /// It will also report the source id for that source. /// - public struct InputSourceInfo : - IInputSourceInfoProvider + public struct InputSourceInfo : IInputSourceInfoProvider { public IInputSource InputSource; public uint SourceId; @@ -42,14 +39,4 @@ public bool Matches(IInputSource otherInputSource, uint otherSourceId) return ((InputSource == otherInputSource) && (SourceId == otherSourceId)); } } - - /// - /// IInputSourceInfoProvider gives you the input source like hands or motion controller. - /// It will also report the source id for that source. - /// - public interface IInputSourceInfoProvider - { - IInputSource InputSource { get; } - uint SourceId { get; } - } } diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInfo.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInfo.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInfo.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInfo.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourcePressInfo.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourcePressInfo.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourcePressInfo.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourcePressInfo.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputControl.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputControl.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputControl.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputControl.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputControl.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputControl.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputControl.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputControl.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions/HandDraggable.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/HandDraggable.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions/HandDraggable.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/HandDraggable.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions/HandDraggable.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/HandDraggable.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions/HandDraggable.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/HandDraggable.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/ManualGazeControl.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/ManualGazeControl.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/ManualGazeControl.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/ManualGazeControl.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/SpeechInputHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/SpeechInputHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/SpeechInputHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/SpeechInputHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TapToPlace.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TapToPlace.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TapToPlace.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TapToPlace.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TriggerButton.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TriggerButton.cs diff --git a/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TriggerButton.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TriggerButton.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/UI.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers.meta similarity index 60% rename from Assets/HoloToolkit/Input/Scripts/UI.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers.meta index 47ec4c38888..0cf9cfa2133 100644 --- a/Assets/HoloToolkit/Input/Scripts/UI.meta +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers.meta @@ -1,9 +1,10 @@ fileFormatVersion: 2 -guid: db8878df5857f754aafe6c6d0e759c69 +guid: 48bb2e829317e7844a9a4162b2ce8112 folderAsset: yes -timeCreated: 1469832109 +timeCreated: 1506540383 licenseType: Pro DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/HandGuidance.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/HandGuidance.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/HandGuidance.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/HandGuidance.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/HandGuidance.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/HandGuidance.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/HandGuidance.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/HandGuidance.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeyboardManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeyboardManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeyboardManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeyboardManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityCameraManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityCameraManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityCameraManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityCameraManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/SetGlobalListener.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/SetGlobalListener.cs index 22e2a20eedc..77cbda8c3af 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/SetGlobalListener.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/SetGlobalListener.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using UnityEngine; - namespace HoloToolkit.Unity.InputModule { /// diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone.meta b/Assets/HoloToolkit/Input/Scripts/Voice.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone.meta rename to Assets/HoloToolkit/Input/Scripts/Voice.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs b/Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs rename to Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs.meta b/Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs b/Assets/HoloToolkit/Input/Scripts/Voice/MicStream.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs rename to Assets/HoloToolkit/Input/Scripts/Voice/MicStream.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs.meta b/Assets/HoloToolkit/Input/Scripts/Voice/MicStream.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Voice/MicStream.cs.meta From a0582e3cad383023019cd70277db649189454804 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 14:45:53 -0700 Subject: [PATCH 07/25] A couple more updates to the WSA wrapping, and better handling of destruction of helper scripts if in Editor and occluded. --- .../Boundary/Scripts/BoundaryManager.cs | 7 +++++-- .../Interactions/EditorInputSelector.cs | 16 ++++++++++------ .../Utilities/Interactions/ManualGazeControl.cs | 14 +++++++++----- .../Scripts/DebugPanelControllerInfo.cs | 14 +++++++------- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs b/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs index b4b0d0ec65d..025a2007af3 100644 --- a/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs +++ b/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using System.Collections.Generic; using UnityEngine; -using UnityEngine.XR; #if UNITY_WSA +using System.Collections.Generic; using UnityEngine.XR.WSA; +using UnityEngine.XR; #endif namespace HoloToolkit.Unity.Boundary @@ -21,10 +21,12 @@ public class BoundaryManager : SingleInstance public GameObject FloorQuad; private GameObject floorQuadInstance; +#if UNITY_WSA [SerializeField] [Tooltip("Approximate max Y height of your space.")] private float boundaryHeight = 10f; private Bounds boundaryBounds; +#endif private bool renderFloor = true; public bool RenderFloor @@ -76,6 +78,7 @@ private void SetBoundaryRendering() UnityEngine.Experimental.XR.Boundary.visible = renderBoundary; } } + #if UNITY_WSA private void Awake() { diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs index ad3eb66a82f..aa1d3b8d653 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs @@ -29,15 +29,19 @@ public class EditorInputSelector : MonoBehaviour private void Awake() { -#if UNITY_EDITOR - if (UnityEngine.XR.XRDevice.isPresent) + if (Application.isEditor) { -#endif - Destroy(gameObject); + if (UnityEngine.XR.XRDevice.isPresent) + { + Destroy(this); + return; + } + } + else + { + Destroy(this); return; -#if UNITY_EDITOR } -#endif Inputs = new List(); diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs index 58413f3aa4d..829d3118b00 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs @@ -34,15 +34,19 @@ public class ManualGazeControl : MonoBehaviour private void Awake() { -#if UNITY_EDITOR - if (UnityEngine.XR.XRDevice.isPresent) + if (Application.isEditor) + { + if (UnityEngine.XR.XRDevice.isPresent) + { + Destroy(this); + return; + } + } + else { -#endif Destroy(this); return; -#if UNITY_EDITOR } -#endif cameraTransform = GetComponent().transform; if (cameraTransform == null) diff --git a/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs b/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs index 9d9c692625c..56ccfb5f0d8 100644 --- a/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs +++ b/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs @@ -2,10 +2,10 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using System; -using System.Collections.Generic; using UnityEngine; #if UNITY_WSA +using System.Collections.Generic; using UnityEngine.XR.WSA.Input; #endif @@ -13,11 +13,10 @@ namespace HoloToolkit.Unity { public class DebugPanelControllerInfo : MonoBehaviour { +#if UNITY_WSA private class ControllerState { -#if UNITY_WSA public InteractionSourceHandedness Handedness; -#endif public Vector3 PointerPosition; public Quaternion PointerRotation; public Vector3 GripPosition; @@ -33,6 +32,9 @@ private class ControllerState public Vector2 TouchpadPosition; } + private Dictionary controllers; +#endif + // Text display label game objects public TextMesh LeftInfoTextPointerPosition; public TextMesh LeftInfoTextPointerRotation; @@ -61,13 +63,11 @@ private class ControllerState public TextMesh RightInfoTextTouchpadTouched; public TextMesh RightInfoTextTouchpadPosition; - private Dictionary controllers; - private void Awake() { +#if UNITY_WSA controllers = new Dictionary(); -#if UNITY_WSA InteractionManager.InteractionSourceDetected += InteractionManager_InteractionSourceDetected; InteractionManager.InteractionSourceLost += InteractionManager_InteractionSourceLost; @@ -126,7 +126,7 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate private string GetControllerInfo() { - string toReturn = ""; + string toReturn = string.Empty; #if UNITY_WSA foreach (ControllerState controllerState in controllers.Values) { From 54c9c5c811abf51fd4ca7d4cece576e802535c63 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 14:51:17 -0700 Subject: [PATCH 08/25] Removed obsolete Keyword Manager and test class. --- .../Input/Scripts/DisplayKeywords.cs | 33 ---- .../Input/Scripts/DisplayKeywords.cs.meta | 12 -- .../Utilities/Managers/KeywordManager.cs | 179 ------------------ .../Utilities/Managers/KeywordManager.cs.meta | 12 -- 4 files changed, 236 deletions(-) delete mode 100644 Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs delete mode 100644 Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs.meta delete mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs delete mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs b/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs deleted file mode 100644 index 86aaf32ced8..00000000000 --- a/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using UnityEngine; -using UnityEngine.UI; - -namespace HoloToolkit.Unity.InputModule.Tests -{ - [Obsolete("See DisplaySpeechKeywords for updated usage.")] - public class DisplayKeywords : MonoBehaviour - { -#if UNITY_EDITOR || UNITY_WSA - public KeywordManager keywordManager; - public Text textPanel; - - private void Start() - { - if (keywordManager == null || textPanel == null) - { - Debug.Log("Please check the variables in the Inspector on DisplayKeywords.cs on" + name + "."); - return; - } - - textPanel.text = "Try saying:\n"; - foreach (KeywordManager.KeywordAndResponse k in keywordManager.KeywordsAndResponses) - { - textPanel.text += k.Keyword + "\n"; - } - } -#endif - } -} \ No newline at end of file diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs.meta b/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs.meta deleted file mode 100644 index 02ef0005774..00000000000 --- a/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 58bad4bea4d136b4b9f6534fae733f97 -timeCreated: 1471038703 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs deleted file mode 100644 index 74be52eb192..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Events; - -#if UNITY_WSA || UNITY_STANDALONE_WIN -using UnityEngine.Windows.Speech; -#endif - -namespace HoloToolkit.Unity.InputModule -{ - /// - /// KeywordManager allows you to specify keywords and methods in the Unity - /// Inspector, instead of registering them explicitly in code. - /// This also includes a setting to either automatically start the - /// keyword recognizer or allow your code to start it. - /// - /// IMPORTANT: Please make sure to add the microphone capability in your app, in Unity under - /// Edit -> Project Settings -> Player -> Settings for Windows Store -> Publishing Settings -> Capabilities - /// or in your Visual Studio Package.appxmanifest capabilities. - /// - [Obsolete("Use HoloToolkit.Unity.InputModule.SpeechInputSource")] - public partial class KeywordManager : MonoBehaviour - { - [System.Serializable] - public struct KeywordAndResponse - { - [Tooltip("The keyword to recognize.")] - public string Keyword; - [Tooltip("The KeyCode to recognize.")] - public KeyCode KeyCode; - [Tooltip("The UnityEvent to be invoked when the keyword is recognized.")] - public UnityEvent Response; - } - - // This enumeration gives the manager two different ways to handle the recognizer. Both will - // set up the recognizer and add all keywords. The first causes the recognizer to start - // immediately. The second allows the recognizer to be manually started at a later time. - public enum RecognizerStartBehavior { AutoStart, ManualStart }; - - [Tooltip("An enumeration to set whether the recognizer should start on or off.")] - public RecognizerStartBehavior RecognizerStart; - - [Tooltip("An array of string keywords and UnityEvents, to be set in the Inspector.")] - public KeywordAndResponse[] KeywordsAndResponses; - -#if UNITY_WSA || UNITY_STANDALONE_WIN - private readonly Dictionary responses = new Dictionary(); - - private KeywordRecognizer keywordRecognizer; - - void Start() - { - int keywordCount = KeywordsAndResponses.Length; - if (keywordCount > 0) - { - try - { - string[] keywords = new string[keywordCount]; - // Convert the struct array into a dictionary, with the keywords and the keys and the methods as the values. - // This helps easily link the keyword recognized to the UnityEvent to be invoked. - for (int index = 0; index < keywordCount; index++) - { - KeywordAndResponse keywordAndResponse = KeywordsAndResponses[index]; - responses[keywordAndResponse.Keyword] = keywordAndResponse.Response; - keywords[index] = keywordAndResponse.Keyword; - } - - keywordRecognizer = new KeywordRecognizer(keywords); - keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized; - - if (RecognizerStart == RecognizerStartBehavior.AutoStart) - { - keywordRecognizer.Start(); - } - } - catch (ArgumentException) - { - Debug.LogError("Duplicate keywords specified in the Inspector on " + gameObject.name + "."); - } - } - else - { - Debug.LogError("Must have at least one keyword specified in the Inspector on " + gameObject.name + "."); - } - } - - void Update() - { - if (keywordRecognizer != null && keywordRecognizer.IsRunning) - { - ProcessKeyBindings(); - } - } - - void OnDestroy() - { - if (keywordRecognizer != null) - { - StopKeywordRecognizer(); - keywordRecognizer.OnPhraseRecognized -= KeywordRecognizer_OnPhraseRecognized; - keywordRecognizer.Dispose(); - } - } - - void OnDisable() - { - if (keywordRecognizer != null) - { - StopKeywordRecognizer(); - } - } - - void OnEnable() - { - if (keywordRecognizer != null && RecognizerStart == RecognizerStartBehavior.AutoStart) - { - StartKeywordRecognizer(); - } - } -#endif - - private void ProcessKeyBindings() - { - foreach (var kvp in KeywordsAndResponses) - { - if (Input.GetKeyDown(kvp.KeyCode)) - { - kvp.Response.Invoke(); - return; - } - } - } - -#if UNITY_WSA || UNITY_STANDALONE_WIN - private void KeywordRecognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args) - { - UnityEvent keywordResponse; - - // Check to make sure the recognized keyword exists in the methods dictionary, then invoke the corresponding method. - if (responses.TryGetValue(args.text, out keywordResponse)) - { - keywordResponse.Invoke(); - } - } -#endif - - /// - /// Make sure the keyword recognizer is off, then start it. - /// Otherwise, leave it alone because it's already in the desired state. - /// - public void StartKeywordRecognizer() - { -#if UNITY_WSA || UNITY_STANDALONE_WIN - if (keywordRecognizer != null && !keywordRecognizer.IsRunning) - { - keywordRecognizer.Start(); - } -#endif - } - - /// - /// Make sure the keyword recognizer is on, then stop it. - /// Otherwise, leave it alone because it's already in the desired state. - /// - public void StopKeywordRecognizer() - { -#if UNITY_WSA || UNITY_STANDALONE_WIN - if (keywordRecognizer != null && keywordRecognizer.IsRunning) - { - keywordRecognizer.Stop(); - } -#endif - } - } -} \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta deleted file mode 100644 index 557b252145f..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3f2795b3e072e1745a4f8c670d64284f -timeCreated: 1455735877 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 40c01f86544faada34084a732e1eb29c2b089c55 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 14:51:31 -0700 Subject: [PATCH 09/25] nicer editor checking --- .../Input/Scripts/InputSources/EditorInputSource.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs index d3110a66e83..fe4da919856 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs @@ -251,16 +251,18 @@ public override bool TryGetMenu(uint sourceId, out bool isPressed) private void Awake() { -#if !UNITY_EDITOR - Destroy(gameObject); -#else + if (Application.isEditor) + { + Destroy(gameObject); + return; + } + manualController = GetComponent(); CurrentButtonStates = new ButtonStates(); currentlyVisible = false; visibilityChanged = false; controllerId = (uint)Random.value; -#endif } #if UNITY_EDITOR From fb22aad0e1bc293ee909772e717bf0a50512ed57 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 15:03:29 -0700 Subject: [PATCH 10/25] Commented out ControllerInfo unimplemented controller components --- .../Input/Scripts/Utilities/ControllerInfo.cs | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs index 9f4bcd8be0c..b9506868262 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs @@ -11,9 +11,10 @@ namespace HoloToolkit.Unity.InputModule /// public class ControllerInfo : MonoBehaviour { - private GameObject home; - private Transform homePressed; - private Transform homeUnpressed; + // TODO: Implement all controller components. + //private GameObject home; + //private Transform homePressed; + //private Transform homeUnpressed; private GameObject menu; private Transform menuPressed; private Transform menuUnpressed; @@ -35,12 +36,12 @@ public class ControllerInfo : MonoBehaviour private GameObject touchpadPress; private Transform touchpadPressed; private Transform touchpadUnpressed; - private GameObject touchpadPressX; - private Transform touchpadPressXMin; - private Transform touchpadPressXMax; - private GameObject touchpadPressY; - private Transform touchpadPressYMin; - private Transform touchpadPressYMax; + //private GameObject touchpadPressX; + //private Transform touchpadPressXMin; + //private Transform touchpadPressXMax; + //private GameObject touchpadPressY; + //private Transform touchpadPressYMin; + //private Transform touchpadPressYMax; private GameObject touchpadTouchX; private Transform touchpadTouchXMin; private Transform touchpadTouchXMax; @@ -82,7 +83,7 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize switch (child.parent.name.ToLower()) { case "home": - homePressed = child; + //homePressed = child; break; case "menu": menuPressed = child; @@ -105,7 +106,7 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize switch (child.parent.name.ToLower()) { case "home": - homeUnpressed = child; + //homeUnpressed = child; break; case "menu": menuUnpressed = child; @@ -134,10 +135,10 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize thumbstickYMin = child; break; case "touchpad_press_x": - touchpadPressXMin = child; + //touchpadPressXMin = child; break; case "touchpad_press_y": - touchpadPressYMin = child; + //touchpadPressYMin = child; break; case "touchpad_touch_x": touchpadTouchXMin = child; @@ -157,10 +158,10 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize thumbstickYMax = child; break; case "touchpad_press_x": - touchpadPressXMax = child; + //touchpadPressXMax = child; break; case "touchpad_press_y": - touchpadPressYMax = child; + //touchpadPressYMax = child; break; case "touchpad_touch_x": touchpadTouchXMax = child; @@ -174,7 +175,7 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize switch (child.parent.name.ToLower()) { case "home": - home = child.gameObject; + //home = child.gameObject; break; case "menu": menu = child.gameObject; @@ -198,10 +199,10 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize touchpadPress = child.gameObject; break; case "touchpad_press_x": - touchpadPressX = child.gameObject; + //touchpadPressX = child.gameObject; break; case "touchpad_press_y": - touchpadPressY = child.gameObject; + //touchpadPressY = child.gameObject; break; case "touchpad_touch_x": touchpadTouchX = child.gameObject; From 6bb1649bbb6de55d24e217a234a52ff36e537b44 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 26 Sep 2017 16:10:27 -0700 Subject: [PATCH 11/25] Removed static flags on text mesh components --- .../Input/Scenes/InputManagerTest.unity | 240 +++++++++++++++--- 1 file changed, 203 insertions(+), 37 deletions(-) diff --git a/Assets/HoloToolkit-Tests/Input/Scenes/InputManagerTest.unity b/Assets/HoloToolkit-Tests/Input/Scenes/InputManagerTest.unity index 935951fdc9b..1191eb984c9 100644 --- a/Assets/HoloToolkit-Tests/Input/Scenes/InputManagerTest.unity +++ b/Assets/HoloToolkit-Tests/Input/Scenes/InputManagerTest.unity @@ -42,7 +42,7 @@ RenderSettings: --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 9 + serializedVersion: 11 m_GIWorkflowMode: 1 m_GISettings: serializedVersion: 2 @@ -54,7 +54,7 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 8 + serializedVersion: 9 m_Resolution: 2 m_BakeResolution: 40 m_TextureWidth: 1024 @@ -77,17 +77,19 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 m_PVRFilteringMode: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 m_LightingDataAsset: {fileID: 0} - m_ShadowMaskMode: 2 + m_UseShadowmask: 1 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -107,6 +109,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &41734711 GameObject: @@ -148,6 +152,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -163,6 +168,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -230,6 +236,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 0 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -245,6 +252,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -399,6 +407,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -414,6 +423,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -469,7 +479,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &149404909 Transform: @@ -514,6 +524,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -529,6 +540,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -588,7 +600,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &173363922 Transform: @@ -633,6 +645,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -648,6 +661,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -671,7 +685,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &200945359 Transform: @@ -716,6 +730,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -731,6 +746,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -822,6 +838,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -930,6 +954,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 0 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -945,6 +970,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1017,6 +1043,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1032,6 +1059,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1074,7 +1102,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &263170636 Transform: @@ -1119,6 +1147,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1134,6 +1163,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1157,7 +1187,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &350032155 Transform: @@ -1202,6 +1232,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1217,6 +1248,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1337,6 +1369,14 @@ Prefab: propertyPath: m_Layer value: 0 objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -1402,7 +1442,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 432117531} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 1.1980001} + m_LocalPosition: {x: 0.049999237, y: 0.47200012, z: 1.1980001} m_LocalScale: {x: 0.003, y: 0.003, z: 0.003} m_Children: - {fileID: 1034968948} @@ -1559,6 +1599,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1574,6 +1615,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1617,7 +1659,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &502235478 Transform: @@ -1664,6 +1706,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1679,6 +1722,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1717,7 +1761,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &556584198 Transform: @@ -1762,6 +1806,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1777,6 +1822,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -1887,6 +1933,14 @@ Prefab: propertyPath: m_LocalScale.z value: 2.5 objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -1906,7 +1960,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &689950062 Transform: @@ -1953,6 +2007,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -1968,6 +2023,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2086,6 +2142,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2101,6 +2158,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2132,7 +2190,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &736112370 Transform: @@ -2177,6 +2235,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2192,6 +2251,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2226,7 +2286,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &764860895 Transform: @@ -2273,6 +2333,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2288,6 +2349,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2418,7 +2480,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &962930258 Transform: @@ -2463,6 +2525,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2478,6 +2541,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2506,7 +2570,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &984922568 Transform: @@ -2555,6 +2619,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2570,6 +2635,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2671,6 +2737,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -2722,7 +2796,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1034531162 Transform: @@ -2767,6 +2841,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2782,6 +2857,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -2971,6 +3047,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 0 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -2986,6 +3063,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3067,7 +3145,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 198000010086851302, guid: 31ed45da60c98354380578a9bde4814d, type: 2} - propertyPath: ShapeModule.radius + propertyPath: ShapeModule.radius.value value: 0.02237308 objectReference: {fileID: 0} m_RemovedComponents: [] @@ -3201,6 +3279,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -3367,7 +3453,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1248870586 Transform: @@ -3412,6 +3498,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3427,6 +3514,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3480,6 +3568,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3495,6 +3584,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3592,8 +3682,9 @@ MonoBehaviour: m_EditorClassIdentifier: HostTransform: {fileID: 0} DistanceScale: 2 - IsKeepUpright: 0 - IsOrientTowardsUser: 1 + RotationMode: 0 + PositionLerpSpeed: 0.2 + RotationLerpSpeed: 0.2 IsDraggingEnabled: 1 --- !u!23 &1282283563 MeshRenderer: @@ -3604,6 +3695,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3619,6 +3711,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3674,6 +3767,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -3689,6 +3783,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -3874,6 +3969,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4074,7 +4177,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1549854632 Transform: @@ -4123,6 +4226,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4138,6 +4242,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4243,6 +4348,14 @@ Prefab: propertyPath: m_Layer value: 0 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4274,6 +4387,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4289,6 +4403,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4412,6 +4527,14 @@ Prefab: propertyPath: m_Layer value: 15 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4441,7 +4564,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1595405691 Transform: @@ -4488,6 +4611,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4503,6 +4627,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4566,6 +4691,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4581,6 +4707,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4617,7 +4744,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1614035368 Transform: @@ -4662,6 +4789,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4677,6 +4805,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -4776,6 +4905,14 @@ Prefab: propertyPath: m_LocalScale.z value: 1.2 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4855,6 +4992,14 @@ Prefab: propertyPath: m_Layer value: 0 objectReference: {fileID: 0} + - target: {fileID: 1000013030286928, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1000010345607974, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} + propertyPath: m_StaticEditorFlags + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000011771025640, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_ParentPrefab: {fileID: 100100000, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} @@ -4954,6 +5099,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -4969,6 +5115,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5000,7 +5147,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1708006763 Transform: @@ -5045,6 +5192,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5060,6 +5208,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5162,7 +5311,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1833810248 Transform: @@ -5211,6 +5360,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5226,6 +5376,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5313,6 +5464,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5328,6 +5480,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5370,7 +5523,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1906609831 Transform: @@ -5417,6 +5570,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5432,6 +5586,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5455,7 +5610,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1925794794 Transform: @@ -5500,6 +5655,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5515,6 +5671,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5581,8 +5738,9 @@ MonoBehaviour: m_EditorClassIdentifier: HostTransform: {fileID: 0} DistanceScale: 2 - IsKeepUpright: 0 - IsOrientTowardsUser: 1 + RotationMode: 0 + PositionLerpSpeed: 0.2 + RotationLerpSpeed: 0.2 IsDraggingEnabled: 1 --- !u!23 &1950385221 MeshRenderer: @@ -5593,6 +5751,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5608,6 +5767,7 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5650,7 +5810,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &1964882465 Transform: @@ -5697,6 +5857,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5712,6 +5873,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5814,7 +5976,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &2091656258 Transform: @@ -5863,6 +6025,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5878,6 +6041,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 @@ -5901,7 +6065,7 @@ GameObject: m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &2128781368 Transform: @@ -5946,6 +6110,7 @@ MeshRenderer: m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 + m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -5961,6 +6126,7 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 + m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 From f88313e542db373ac837b246954f5ba45bf61422 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 26 Sep 2017 18:49:17 -0700 Subject: [PATCH 12/25] First pass at Input System Update. --- .../Boundary/Scripts/BoundaryTest.cs | 15 +- .../Input/Scripts/HapticsTest.cs | 9 +- .../Input/Scripts/InputHandleCallbackFX.cs | 3 +- .../Input/Scripts/SphereGlobalKeywords.cs | 2 +- .../Input/Scripts/SphereKeywords.cs | 2 +- .../Scripts/TextToSpeechOnTapTest.cs | 3 +- .../Boundary/Scripts/BoundaryManager.cs | 6 +- .../Scripts/Gaze/MixedRealityTeleport.cs | 9 +- .../InputEventData/InputClickedEventData.cs | 3 +- .../Scripts/InputEventData/InputEventData.cs | 7 +- .../InputEventData/InputPositionEventData.cs | 5 +- ...ognizedEventData.cs => SpeechEventData.cs} | 11 +- ...ntData.cs.meta => SpeechEventData.cs.meta} | 0 .../Scripts/InputHandlers/ISpeechHandler.cs | 2 +- .../HoloToolkit/Input/Scripts/InputManager.cs | 28 ++- .../Scripts/InputSources/BaseInputSource.cs | 3 +- .../Scripts/InputSources/EditorInputSource.cs | 30 +-- .../InputSources/GamePadInputSource.cs | 5 +- .../Scripts/InputSources/GamepadInput.cs | 18 +- .../Scripts/InputSources/IInputSource.cs | 3 +- .../InteractionSourceInputSource.cs | 185 +++++++++--------- .../Microphone/DictationInputManager.cs | 5 +- .../Input/Scripts/UI/TriggerButton.cs | 3 +- .../Utilities/InteractionSourceInfo.cs | 13 ++ .../Utilities/InteractionSourceInfo.cs.meta | 13 ++ .../Utilities/InteractionSourcePressInfo.cs | 15 ++ .../InteractionSourcePressInfo.cs.meta | 13 ++ .../Utilities/MixedRealityCameraManager.cs | 24 ++- .../Input/Scripts/Voice/SpeechInputHandler.cs | 2 +- .../Input/Scripts/Voice/SpeechInputSource.cs | 15 +- .../Scripts/PlayerController.cs | 10 +- .../Scripts/UNetSharedHologram.cs | 23 +-- .../ScrollingSessionListUIController.cs | 9 +- .../UI/Scripts/StartSessionButton.cs | 4 +- .../Scripts/DebugPanelControllerInfo.cs | 11 +- .../Utilities/Scripts/HeadsetAdjustment.cs | 2 +- 36 files changed, 306 insertions(+), 205 deletions(-) rename Assets/HoloToolkit/Input/Scripts/InputEventData/{SpeechKeywordRecognizedEventData.cs => SpeechEventData.cs} (89%) rename Assets/HoloToolkit/Input/Scripts/InputEventData/{SpeechKeywordRecognizedEventData.cs.meta => SpeechEventData.cs.meta} (100%) create mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs create mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta create mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs create mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta diff --git a/Assets/HoloToolkit-Tests/Boundary/Scripts/BoundaryTest.cs b/Assets/HoloToolkit-Tests/Boundary/Scripts/BoundaryTest.cs index bda5cc3adaa..88bb34eda53 100644 --- a/Assets/HoloToolkit-Tests/Boundary/Scripts/BoundaryTest.cs +++ b/Assets/HoloToolkit-Tests/Boundary/Scripts/BoundaryTest.cs @@ -7,10 +7,11 @@ namespace HoloToolkit.Unity.Boundary.Tests { public class BoundaryTest : MonoBehaviour { - private Material[] defaultMaterials; + private Material[] defaultMaterials = null; private void Start() { +#if UNITY_WSA BoundaryManager.Instance.RenderBoundary = true; BoundaryManager.Instance.RenderFloor = true; @@ -27,6 +28,18 @@ private void Start() defaultMaterials[i].SetColor("_Color", highlightColor); } } +#else + BoundaryManager.Instance.RenderBoundary = false; + BoundaryManager.Instance.RenderFloor = false; +#endif + } + + private void OnDestroy() + { + for (int i = 0; i < defaultMaterials.Length; i++) + { + Destroy(defaultMaterials[i]); + } } } } diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/HapticsTest.cs b/Assets/HoloToolkit-Tests/Input/Scripts/HapticsTest.cs index 64a872ab548..c69999aad5f 100644 --- a/Assets/HoloToolkit-Tests/Input/Scripts/HapticsTest.cs +++ b/Assets/HoloToolkit-Tests/Input/Scripts/HapticsTest.cs @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using HoloToolkit.Unity.InputModule; using UnityEngine; -using UnityEngine.XR.WSA.Input; +using HoloToolkit.Unity.InputModule; namespace HoloToolkit.Unity.Tests { @@ -17,10 +16,10 @@ void IInputHandler.OnInputDown(InputEventData eventData) { switch (eventData.PressType) { - case InteractionSourcePressType.Grasp: + case InteractionSourcePressInfo.Grasp: inputSource.StartHaptics(eventData.SourceId, 1.0f); return; - case InteractionSourcePressType.Menu: + case InteractionSourcePressInfo.Menu: inputSource.StartHaptics(eventData.SourceId, 1.0f, 1.0f); return; } @@ -32,7 +31,7 @@ void IInputHandler.OnInputUp(InputEventData eventData) InteractionSourceInputSource inputSource = eventData.InputSource as InteractionSourceInputSource; if (inputSource != null) { - if (eventData.PressType == InteractionSourcePressType.Grasp) + if (eventData.PressType == InteractionSourcePressInfo.Grasp) { inputSource.StopHaptics(eventData.SourceId); } diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/InputHandleCallbackFX.cs b/Assets/HoloToolkit-Tests/Input/Scripts/InputHandleCallbackFX.cs index 51ce3893b73..423f481e727 100644 --- a/Assets/HoloToolkit-Tests/Input/Scripts/InputHandleCallbackFX.cs +++ b/Assets/HoloToolkit-Tests/Input/Scripts/InputHandleCallbackFX.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule.Tests { @@ -23,7 +22,7 @@ void IInputHandler.OnInputDown(InputEventData eventData) void IInputHandler.OnInputUp(InputEventData eventData) { - if (eventData.PressType == InteractionSourcePressType.Select) + if (eventData.PressType == InteractionSourcePressInfo.Select) { FocusDetails? focusDetails = FocusManager.Instance.TryGetFocusDetails(eventData); diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/SphereGlobalKeywords.cs b/Assets/HoloToolkit-Tests/Input/Scripts/SphereGlobalKeywords.cs index 1e2399fe668..6c412ac9a73 100644 --- a/Assets/HoloToolkit-Tests/Input/Scripts/SphereGlobalKeywords.cs +++ b/Assets/HoloToolkit-Tests/Input/Scripts/SphereGlobalKeywords.cs @@ -22,7 +22,7 @@ private void Awake() } } - public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) + public void OnSpeechKeywordRecognized(SpeechEventData eventData) { switch (eventData.RecognizedText.ToLower()) { diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/SphereKeywords.cs b/Assets/HoloToolkit-Tests/Input/Scripts/SphereKeywords.cs index 85cafcf890c..de157c715de 100644 --- a/Assets/HoloToolkit-Tests/Input/Scripts/SphereKeywords.cs +++ b/Assets/HoloToolkit-Tests/Input/Scripts/SphereKeywords.cs @@ -38,7 +38,7 @@ public void ResetColor() cachedMaterial.SetColor("_Color", defaultColor); } - public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) + public void OnSpeechKeywordRecognized(SpeechEventData eventData) { ChangeColor(eventData.RecognizedText); } diff --git a/Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs b/Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs index d93427c316c..4f9c679352f 100644 --- a/Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs +++ b/Assets/HoloToolkit-Tests/Utilities/Scripts/TextToSpeechOnTapTest.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule.Tests { @@ -19,7 +18,7 @@ public void OnInputClicked(InputClickedEventData eventData) { // If we have a text to speech manager on the target object, say something. // This voice will appear to emanate from the object. - if (textToSpeech != null && eventData.PressType == InteractionSourcePressType.Select) + if (textToSpeech != null && eventData.PressType == InteractionSourcePressInfo.Select) { // Create message var msg = string.Format( diff --git a/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs b/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs index fb7c3937f89..b4b0d0ec65d 100644 --- a/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs +++ b/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs @@ -4,7 +4,10 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.XR; + +#if UNITY_WSA using UnityEngine.XR.WSA; +#endif namespace HoloToolkit.Unity.Boundary { @@ -73,7 +76,7 @@ private void SetBoundaryRendering() UnityEngine.Experimental.XR.Boundary.visible = renderBoundary; } } - +#if UNITY_WSA private void Awake() { // Render the floor based on if you are in editor or immersive device. @@ -187,5 +190,6 @@ public void CalculateBoundaryVolume() // Ensuring that we set height of the bounds volume to be say 10 feet tall. boundaryBounds.Encapsulate(new Vector3(0, boundaryHeight, 0)); } +#endif } } diff --git a/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs b/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs index 7962fff05f0..1103a2b6445 100644 --- a/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs +++ b/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs @@ -5,7 +5,10 @@ using System; using UnityEngine; using UnityEngine.XR; + +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +#endif namespace HoloToolkit.Unity.InputModule { @@ -73,12 +76,14 @@ private void Start() } } - void Update() + private void Update() { +#if UNITY_WSA if (InteractionManager.numSourceStates == 0) { HandleGamepad(); } +#endif if (currentPointingSource != null) { @@ -143,7 +148,7 @@ private void HandleGamepad() void IControllerInputHandler.OnInputPositionChanged(InputPositionEventData eventData) { - if (eventData.PressType == InteractionSourcePressType.Thumbstick) + if (eventData.PressType == InteractionSourcePressInfo.Thumbstick) { if (EnableTeleport) { diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputClickedEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputClickedEventData.cs index c07a95a39c4..7d8901d366d 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputClickedEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputClickedEventData.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine.EventSystems; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -20,7 +19,7 @@ public InputClickedEventData(EventSystem eventSystem) : base(eventSystem) { } - public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressType pressType, int tapCount) + public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressInfo pressType, int tapCount) { Initialize(inputSource, sourceId, tag, pressType); TapCount = tapCount; diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputEventData.cs index 5e817e87850..2cf4c74d85c 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputEventData.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine.EventSystems; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -14,14 +13,14 @@ public class InputEventData : BaseInputEventData /// /// Button type that initiated the event. /// - public InteractionSourcePressType PressType { get; private set; } + public InteractionSourcePressInfo PressType { get; private set; } public InputEventData(EventSystem eventSystem) : base(eventSystem) { } - public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressType pressType) + public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressInfo pressType) { BaseInitialize(inputSource, sourceId, tag); PressType = pressType; } } -} \ No newline at end of file +} diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputPositionEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputPositionEventData.cs index 8ff60ef0199..1a4a671049f 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/InputPositionEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/InputPositionEventData.cs @@ -3,7 +3,6 @@ using UnityEngine; using UnityEngine.EventSystems; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -18,10 +17,10 @@ public InputPositionEventData(EventSystem eventSystem) : base(eventSystem) { } - public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressType pressType, Vector2 position) + public void Initialize(IInputSource inputSource, uint sourceId, object tag, InteractionSourcePressInfo pressType, Vector2 position) { Initialize(inputSource, sourceId, tag, pressType); Position = position; } } -} \ No newline at end of file +} diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs similarity index 89% rename from Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs rename to Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs index e1ab069b0cc..4bb77815494 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs @@ -13,7 +13,7 @@ namespace HoloToolkit.Unity.InputModule /// /// Describes an input event that involves keyword recognition. /// - public class SpeechKeywordRecognizedEventData : BaseInputEventData + public class SpeechEventData : BaseInputEventData { /// /// The time it took for the phrase to be uttered. @@ -30,19 +30,20 @@ public class SpeechKeywordRecognizedEventData : BaseInputEventData /// public string RecognizedText { get; private set; } -#if UNITY_EDITOR || UNITY_WSA + public SpeechEventData(EventSystem eventSystem) : base(eventSystem) { } + +#if UNITY_WSA || UNITY_STANDALONE_WIN + /// /// A measure of correct recognition certainty. /// public ConfidenceLevel Confidence { get; private set; } - + /// /// A semantic meaning of recognized phrase. /// public SemanticMeaning[] SemanticMeanings { get; private set; } - public SpeechKeywordRecognizedEventData(EventSystem eventSystem) : base(eventSystem) { } - public void Initialize(IInputSource inputSource, uint sourceId, object tag, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText) { BaseInitialize(inputSource, sourceId, tag); diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechKeywordRecognizedEventData.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputEventData/SpeechEventData.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISpeechHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISpeechHandler.cs index 92dd5355350..039a700dccf 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISpeechHandler.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISpeechHandler.cs @@ -10,6 +10,6 @@ namespace HoloToolkit.Unity.InputModule /// public interface ISpeechHandler : IEventSystemHandler { - void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData); + void OnSpeechKeywordRecognized(SpeechEventData eventData); } } \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/InputManager.cs index 1b25373bd51..81f3828a88c 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputManager.cs @@ -9,8 +9,6 @@ using UnityEngine; using UnityEngine.EventSystems; -//TODO wrap XR.WSA namespace. -using UnityEngine.XR.WSA.Input; #if UNITY_WSA || UNITY_STANDALONE_WIN using UnityEngine.Windows.Speech; #endif @@ -56,7 +54,7 @@ public class InputManager : Singleton private GamePadEventData gamePadEventData; private XboxControllerEventData xboxControllerEventData; #if UNITY_WSA || UNITY_STANDALONE_WIN - private SpeechKeywordRecognizedEventData speechKeywordRecognizedEventData; + private SpeechEventData speechEventData; private DictationEventData dictationEventData; #endif @@ -229,7 +227,7 @@ private void InitializeEventDatas() gamePadEventData = new GamePadEventData(EventSystem.current); xboxControllerEventData = new XboxControllerEventData(EventSystem.current); #if UNITY_WSA || UNITY_STANDALONE_WIN - speechKeywordRecognizedEventData = new SpeechKeywordRecognizedEventData(EventSystem.current); + speechEventData = new SpeechEventData(EventSystem.current); dictationEventData = new DictationEventData(EventSystem.current); #endif } @@ -398,7 +396,7 @@ public void HandleEvent(BaseEventData eventData, ExecuteEvents.EventFunction< handler.OnInputClicked(casted); }; - public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSourcePressType pressType, int tapCount, object tag = null) + public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, int tapCount, object tag = null) { // Create input event sourceClickedEventData.Initialize(source, sourceId, tag, pressType, tapCount); @@ -416,7 +414,7 @@ public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSou handler.OnInputUp(casted); }; - public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourcePressType pressType, object tag = null) + public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object tag = null) { // Create input event inputEventData.Initialize(source, sourceId, tag, pressType); @@ -425,7 +423,7 @@ public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourceP HandleEvent(inputEventData, OnSourceUpEventHandler); // UI events - if (ShouldSendUnityUiEvents && (pressType == InteractionSourcePressType.Select)) + if (ShouldSendUnityUiEvents && pressType == InteractionSourcePressInfo.Select) { PointerInputEventData pointerInputEventData = FocusManager.Instance.BorrowPointerEventData(); pointerInputEventData.InputSource = source; @@ -443,7 +441,7 @@ public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourceP handler.OnInputDown(casted); }; - public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourcePressType pressType, object tag = null) + public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object tag = null) { // Create input event inputEventData.Initialize(source, sourceId, tag, pressType); @@ -452,7 +450,7 @@ public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourc HandleEvent(inputEventData, OnSourceDownEventHandler); // UI events - if (ShouldSendUnityUiEvents && (pressType == InteractionSourcePressType.Select)) + if (ShouldSendUnityUiEvents && pressType == InteractionSourcePressInfo.Select) { PointerInputEventData pointerInputEventData = FocusManager.Instance.BorrowPointerEventData(); pointerInputEventData.InputSource = source; @@ -731,7 +729,7 @@ public void RaiseNavigationCanceled(IInputSource source, uint sourceId, object t handler.OnInputPositionChanged(casted); }; - public void RaiseInputPositionChanged(IInputSource source, uint sourceId, InteractionSourcePressType pressType, Vector2 position, object tag = null) + public void RaiseInputPositionChanged(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, Vector2 position, object tag = null) { // Create input event inputPositionEventData.Initialize(source, sourceId, tag, pressType, position); @@ -766,7 +764,7 @@ public void RaiseSelectPressedAmountChanged(IInputSource source, uint sourceId, public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object tag = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressType.Touchpad); + inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressInfo.Touchpad); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnTouchpadTouchedEventHandler); @@ -782,7 +780,7 @@ public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object tag public void RaiseTouchpadReleased(IInputSource source, uint sourceId, object tag = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressType.Touchpad); + inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressInfo.Touchpad); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnTouchpadReleasedEventHandler); @@ -884,17 +882,17 @@ public void RaiseXboxInputUpdate(IInputSource source, uint sourceId, XboxControl private static readonly ExecuteEvents.EventFunction OnSpeechKeywordRecognizedEventHandler = delegate (ISpeechHandler handler, BaseEventData eventData) { - SpeechKeywordRecognizedEventData casted = ExecuteEvents.ValidateEventData(eventData); + SpeechEventData casted = ExecuteEvents.ValidateEventData(eventData); handler.OnSpeechKeywordRecognized(casted); }; public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string text, object tag = null) { // Create input event - speechKeywordRecognizedEventData.Initialize(source, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); + speechEventData.Initialize(source, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(speechKeywordRecognizedEventData, OnSpeechKeywordRecognizedEventHandler); + HandleEvent(speechEventData, OnSpeechKeywordRecognizedEventHandler); } private static readonly ExecuteEvents.EventFunction OnDictationHypothesisEventHandler = diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/BaseInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/BaseInputSource.cs index 67dc36add01..22e9414d2f6 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/BaseInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/BaseInputSource.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -18,7 +17,7 @@ public bool SupportsInputInfo(uint sourceId, SupportedInputInfo inputInfo) return ((GetSupportedInputInfo(sourceId) & inputInfo) == inputInfo); } - public abstract bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind); + public abstract bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind); public abstract bool TryGetPointerPosition(uint sourceId, out Vector3 position); diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs index 9d204a9aac2..fc76415afa0 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs @@ -2,7 +2,10 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; + +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +#endif namespace HoloToolkit.Unity.InputModule { @@ -53,7 +56,7 @@ public ButtonStates() public bool SupportsMenuButton; public bool SupportsGrasp; public bool RaiseEventsBasedOnVisibility; - public InteractionSourceKind SourceKind; + public InteractionSourceInfo SourceKind; public Vector3 ControllerPosition; public Quaternion ControllerRotation; @@ -74,7 +77,7 @@ public ButtonStates() /// private const float MaxClickDuration = 0.5f; - [SerializeField] + [SerializeField] [Tooltip("The total amount of input source movement that needs to happen to signal intent to start a manipulation. This is a distance, but not a distance in any one direction.")] private float manipulationStartMovementThreshold = 0.03f; @@ -112,11 +115,11 @@ public override SupportedInputInfo GetSupportedInputInfo(uint sourceId) return supportedInputInfo; } - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { Debug.Assert(sourceId == controllerId, "Controller data requested for a mismatched source ID."); - sourceKind = this.SourceKind; + sourceKind = SourceKind; return true; } @@ -402,12 +405,12 @@ private void UpdateControllerState(DebugInteractionSourceState source) private void SendControllerStateEvents(float time) { // TODO: Send other new input manager events relating to source updates. - +#if UNITY_WSA if (CurrentButtonStates.SelectButtonStateChanged) { if (CurrentButtonStates.IsSelectButtonDown) { - InputManager.Instance.RaiseSourceDown(this, controllerId, InteractionSourcePressType.Select); + InputManager.Instance.RaiseSourceDown(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Select); } // New up presses require sending different events depending on whether it's also a click, hold, or manipulation. else @@ -427,9 +430,9 @@ private void SendControllerStateEvents(float time) else { // We currently only support single taps in editor. - InputManager.Instance.RaiseInputClicked(this, controllerId, InteractionSourcePressType.Select, 1); + InputManager.Instance.RaiseInputClicked(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Select, 1); } - InputManager.Instance.RaiseSourceUp(this, controllerId, InteractionSourcePressType.Select); + InputManager.Instance.RaiseSourceUp(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Select); } } // If the select state hasn't changed, but it's down, that means it might @@ -468,11 +471,11 @@ private void SendControllerStateEvents(float time) { if (CurrentButtonStates.IsMenuButtonDown) { - InputManager.Instance.RaiseSourceDown(this, controllerId, InteractionSourcePressType.Menu); + InputManager.Instance.RaiseSourceDown(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Menu); } else { - InputManager.Instance.RaiseSourceUp(this, controllerId, InteractionSourcePressType.Menu); + InputManager.Instance.RaiseSourceUp(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Menu); } } @@ -480,17 +483,18 @@ private void SendControllerStateEvents(float time) { if (CurrentButtonStates.IsGrasped) { - InputManager.Instance.RaiseSourceDown(this, controllerId, InteractionSourcePressType.Grasp); + InputManager.Instance.RaiseSourceDown(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Grasp); } else { - InputManager.Instance.RaiseSourceUp(this, controllerId, InteractionSourcePressType.Grasp); + InputManager.Instance.RaiseSourceUp(this, controllerId, (InteractionSourcePressInfo)InteractionSourcePressType.Grasp); } } +#endif } /// - /// Sends the events for hand visibility changes & controller connect/disocnnect. + /// Sends the events for hand visibility changes & controller connect/disconnect. /// private void SendControllerVisibilityEvents() { diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs index 8ec8ff80712..45e27653417 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -45,9 +44,9 @@ protected virtual void RefreshDevices() #region Base Input Source Methods - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceKind.Voice; + sourceKind = InteractionSourceInfo.Voice; return true; } diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs index 0fff06015f6..bcd01325d25 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs @@ -3,7 +3,10 @@ using System; using UnityEngine; + +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +#endif namespace HoloToolkit.Unity.InputModule { @@ -13,6 +16,7 @@ namespace HoloToolkit.Unity.InputModule /// Gamepad button A pressed maps to hold started, completed, canceled gesture. /// Gamepad button A pressed plus left joystick rotate maps to navigation gesture. /// + [Obsolete("Please use GamePadInputSource or XboxControllerInputSource")] public class GamepadInput : BaseInputSource { [Tooltip("Game pad button to press for air tap.")] @@ -60,7 +64,7 @@ protected override void Start() { inputManager = InputManager.Instance; } - + if (inputManager == null) { Debug.LogError("Ensure your scene has the InputManager prefab."); @@ -70,10 +74,12 @@ protected override void Start() private void Update() { +#if UNITY_WSA if (InteractionManager.numSourceStates > 0) { return; } +#endif HandleGamepadAPressed(); } @@ -83,7 +89,7 @@ private void HandleGamepadAPressed() // TODO: Should this handle Submit from Edit > ProjectSettings > Input ? if (Input.GetButtonDown(GamePadButtonA)) { - inputManager.RaiseSourceDown(this, GamePadId, InteractionSourcePressType.Select); + inputManager.RaiseSourceDown(this, GamePadId, InteractionSourcePressInfo.Select); isAPressed = true; navigationCompleted = false; currentGestureState = GestureState.APressed; @@ -150,7 +156,7 @@ private void HandleGamepadAReleased() { if (Input.GetButtonUp(GamePadButtonA)) { - inputManager.RaiseSourceUp(this, GamePadId, InteractionSourcePressType.Select); + inputManager.RaiseSourceUp(this, GamePadId, InteractionSourcePressInfo.Select); switch (currentGestureState) { @@ -176,7 +182,7 @@ private void HandleGamepadAReleased() default: CancelInvoke("HandleHoldStarted"); CancelInvoke("HandleHoldCompleted"); - inputManager.RaiseInputClicked(this, GamePadId, InteractionSourcePressType.Select, 1); + inputManager.RaiseInputClicked(this, GamePadId, InteractionSourcePressInfo.Select, 1); Reset(); break; } @@ -249,9 +255,9 @@ public override bool TryGetGripRotation(uint sourceId, out Quaternion rotation) return false; } - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceKind.Controller; + sourceKind = InteractionSourceInfo.Controller; return true; } diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs index 59ab6c53812..d397b525208 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -24,7 +23,7 @@ public interface IInputSource /// Input info type that we want to get information about. bool SupportsInputInfo(uint sourceId, SupportedInputInfo inputInfo); - bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind); + bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind); /// /// Returns the position of the input source, if available. diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs index df55843640f..1bcb65d2c3c 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using System.Collections.Generic; using UnityEngine; -#if UNITY_EDITOR || UNITY_WSA +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +using System.Collections.Generic; #endif namespace HoloToolkit.Unity.InputModule @@ -28,13 +28,14 @@ public enum RecognizerStartBehavior { AutoStart, ManualStart } [Tooltip("Set to true to use the use rails (guides) for the navigation gesture, as opposed to full 3D navigation.")] public bool UseRailsNavigation = false; -#if UNITY_EDITOR || UNITY_WSA +#if UNITY_WSA protected GestureRecognizer gestureRecognizer; protected GestureRecognizer navigationGestureRecognizer; #endif #region IInputSource Capabilities and SourceData +#if UNITY_WSA private struct SourceCapability { public bool IsSupported; @@ -143,13 +144,14 @@ public void ResetUpdatedBooleans() /// Dictionary linking each source ID to its data. /// private readonly Dictionary sourceIdToData = new Dictionary(4); - - #endregion +#endif + #endregion IInputSource Capabilities and SourceData #region MonoBehaviour Functions private void Awake() { +#if UNITY_WSA gestureRecognizer = new GestureRecognizer(); gestureRecognizer.Tapped += GestureRecognizer_Tapped; @@ -186,10 +188,12 @@ private void Awake() GestureSettings.NavigationY | GestureSettings.NavigationZ); } +#endif } protected virtual void OnDestroy() { +#if UNITY_WSA InteractionManager.InteractionSourceUpdated -= InteractionManager_InteractionSourceUpdated; InteractionManager.InteractionSourceReleased -= InteractionManager_InteractionSourceReleased; @@ -223,21 +227,23 @@ protected virtual void OnDestroy() navigationGestureRecognizer.Dispose(); } +#endif } protected override void OnEnableAfterStart() { base.OnEnableAfterStart(); +#if UNITY_WSA if (RecognizerStart == RecognizerStartBehavior.AutoStart) { StartGestureRecognizers(); } - foreach (InteractionSourceState iss in InteractionManager.GetCurrentReading()) + foreach (InteractionSourceState state in InteractionManager.GetCurrentReading()) { - GetOrAddSourceData(iss.source); - InputManager.Instance.RaiseSourceDetected(this, iss.source.id); + GetOrAddSourceData(state.source); + InputManager.Instance.RaiseSourceDetected(this, state.source.id); } InteractionManager.InteractionSourceUpdated += InteractionManager_InteractionSourceUpdated; @@ -247,12 +253,15 @@ protected override void OnEnableAfterStart() InteractionManager.InteractionSourceLost += InteractionManager_InteractionSourceLost; InteractionManager.InteractionSourceDetected += InteractionManager_InteractionSourceDetected; +#else + RecognizerStart = RecognizerStartBehavior.ManualStart; +#endif } protected override void OnDisableAfterStart() { StopGestureRecognizers(); - +#if UNITY_WSA InteractionManager.InteractionSourceUpdated -= InteractionManager_InteractionSourceUpdated; InteractionManager.InteractionSourceReleased -= InteractionManager_InteractionSourceReleased; @@ -267,6 +276,7 @@ protected override void OnDisableAfterStart() sourceIdToData.Remove(iss.source.id); InputManager.Instance.RaiseSourceLost(this, iss.source.id); } +#endif base.OnDisableAfterStart(); } @@ -275,7 +285,7 @@ protected override void OnDisableAfterStart() public void StartGestureRecognizers() { -#if UNITY_EDITOR || UNITY_WSA +#if UNITY_WSA if (gestureRecognizer != null) { gestureRecognizer.StartCapturingGestures(); @@ -290,7 +300,7 @@ public void StartGestureRecognizers() public void StopGestureRecognizers() { -#if UNITY_EDITOR || UNITY_WSA +#if UNITY_WSA if (gestureRecognizer != null) { gestureRecognizer.StopCapturingGestures(); @@ -307,8 +317,8 @@ public void StopGestureRecognizers() public override SupportedInputInfo GetSupportedInputInfo(uint sourceId) { - SupportedInputInfo retVal = SupportedInputInfo.None; - + var retVal = SupportedInputInfo.None; +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData)) { @@ -321,97 +331,98 @@ public override SupportedInputInfo GetSupportedInputInfo(uint sourceId) retVal |= GetSupportFlag(sourceData.Menu, SupportedInputInfo.Menu); retVal |= GetSupportFlag(sourceData.Grasp, SupportedInputInfo.Grasp); } - +#endif return retVal; } - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData)) { - sourceKind = sourceData.SourceKind; + sourceKind = (InteractionSourceInfo)sourceData.SourceKind; return true; } - else - { - sourceKind = default(InteractionSourceKind); - return false; - } +#endif + + sourceKind = default(InteractionSourceInfo); + return false; } public override bool TryGetPointerPosition(uint sourceId, out Vector3 position) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.PointerPosition, out position)) { return true; } - else - { - position = default(Vector3); - return false; - } +#endif + + position = default(Vector3); + return false; } public override bool TryGetPointerRotation(uint sourceId, out Quaternion rotation) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.PointerRotation, out rotation)) { return true; } - else - { - rotation = default(Quaternion); - return false; - } +#endif + + rotation = default(Quaternion); + return false; } public override bool TryGetPointingRay(uint sourceId, out Ray pointingRay) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.PointingRay, out pointingRay)) { return true; } - else - { - pointingRay = default(Ray); - return false; - } +#endif + + pointingRay = default(Ray); + return false; } public override bool TryGetGripPosition(uint sourceId, out Vector3 position) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.GripPosition, out position)) { return true; } - else - { - position = default(Vector3); - return false; - } +#endif + + position = default(Vector3); + return false; } public override bool TryGetGripRotation(uint sourceId, out Quaternion rotation) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.GripRotation, out rotation)) { return true; } - else - { - rotation = default(Quaternion); - return false; - } +#endif + + rotation = default(Quaternion); + return false; } public override bool TryGetThumbstick(uint sourceId, out bool thumbstickPressed, out Vector2 thumbstickPosition) { +#if UNITY_WSA SourceData sourceData; AxisButton2D thumbstick; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Thumbstick, out thumbstick)) @@ -420,16 +431,16 @@ public override bool TryGetThumbstick(uint sourceId, out bool thumbstickPressed, thumbstickPosition = thumbstick.Position; return true; } - else - { - thumbstickPressed = false; - thumbstickPosition = Vector2.zero; - return false; - } +#endif + + thumbstickPressed = false; + thumbstickPosition = Vector2.zero; + return false; } public override bool TryGetTouchpad(uint sourceId, out bool touchpadPressed, out bool touchpadTouched, out Vector2 touchpadPosition) { +#if UNITY_WSA SourceData sourceData; TouchpadData touchpad; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Touchpad, out touchpad)) @@ -439,17 +450,17 @@ public override bool TryGetTouchpad(uint sourceId, out bool touchpadPressed, out touchpadPosition = touchpad.AxisButton.Position; return true; } - else - { - touchpadPressed = false; - touchpadTouched = false; - touchpadPosition = Vector2.zero; - return false; - } +#endif + + touchpadPressed = false; + touchpadTouched = false; + touchpadPosition = Vector2.zero; + return false; } public override bool TryGetSelect(uint sourceId, out bool selectPressed, out double selectPressedAmount) { +#if UNITY_WSA SourceData sourceData; AxisButton1D select; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Select, out select)) @@ -458,42 +469,43 @@ public override bool TryGetSelect(uint sourceId, out bool selectPressed, out dou selectPressedAmount = select.PressedAmount; return true; } - else - { - selectPressed = false; - selectPressedAmount = 0; - return false; - } +#endif + + selectPressed = false; + selectPressedAmount = 0; + return false; } public override bool TryGetGrasp(uint sourceId, out bool graspPressed) { +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Grasp, out graspPressed)) { return true; } - else - { - graspPressed = false; - return false; - } +#endif + + graspPressed = false; + return false; } public override bool TryGetMenu(uint sourceId, out bool menuPressed) { + +#if UNITY_WSA SourceData sourceData; if (sourceIdToData.TryGetValue(sourceId, out sourceData) && TryGetReading(sourceData.Menu, out menuPressed)) { return true; } - else - { - menuPressed = false; - return false; - } +#endif + + menuPressed = false; + return false; } +#if UNITY_WSA private bool TryGetReading(SourceCapability capability, out TReading reading) { if (capability.IsAvailable) @@ -503,18 +515,15 @@ private bool TryGetReading(SourceCapability capability, out reading = capability.CurrentReading; return true; } - else - { - reading = default(TReading); - return false; - } + reading = default(TReading); + return false; } private SupportedInputInfo GetSupportFlag(SourceCapability capability, SupportedInputInfo flagIfSupported) { return (capability.IsSupported ? flagIfSupported : SupportedInputInfo.None); } - +#endif #endregion public void StartHaptics(uint sourceId, float intensity) @@ -550,6 +559,7 @@ public void StopHaptics(uint sourceId) #endif } +#if UNITY_WSA #region InteractionManager Events private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdatedEventArgs args) @@ -572,12 +582,12 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate if (sourceData.ThumbstickPositionUpdated) { - InputManager.Instance.RaiseInputPositionChanged(this, sourceData.SourceId, InteractionSourcePressType.Thumbstick, sourceData.Thumbstick.CurrentReading.Position); + InputManager.Instance.RaiseInputPositionChanged(this, sourceData.SourceId, InteractionSourcePressInfo.Thumbstick, sourceData.Thumbstick.CurrentReading.Position); } if (sourceData.TouchpadPositionUpdated) { - InputManager.Instance.RaiseInputPositionChanged(this, sourceData.SourceId, InteractionSourcePressType.Touchpad, sourceData.Touchpad.CurrentReading.AxisButton.Position); + InputManager.Instance.RaiseInputPositionChanged(this, sourceData.SourceId, InteractionSourcePressInfo.Touchpad, sourceData.Touchpad.CurrentReading.AxisButton.Position); } if (sourceData.TouchpadTouchedUpdated) @@ -600,12 +610,12 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args) { - InputManager.Instance.RaiseSourceUp(this, args.state.source.id, args.pressType); + InputManager.Instance.RaiseSourceUp(this, args.state.source.id, (InteractionSourcePressInfo)args.pressType); } private void InteractionManager_InteractionSourcePressed(InteractionSourcePressedEventArgs args) { - InputManager.Instance.RaiseSourceDown(this, args.state.source.id, args.pressType); + InputManager.Instance.RaiseSourceDown(this, args.state.source.id, (InteractionSourcePressInfo)args.pressType); } private void InteractionManager_InteractionSourceLost(InteractionSourceLostEventArgs args) @@ -757,12 +767,11 @@ private void UpdateSourceData(InteractionSourceState interactionSourceState, Sou #region Raise GestureRecognizer Events -#if UNITY_EDITOR || UNITY_WSA // TODO: robertes: Should these also cause source state data to be stored/updated? What about SourceDetected synthesized events? protected void GestureRecognizer_Tapped(TappedEventArgs obj) { - InputManager.Instance.RaiseInputClicked(this, obj.source.id, InteractionSourcePressType.Select, obj.tapCount); + InputManager.Instance.RaiseInputClicked(this, obj.source.id, InteractionSourcePressInfo.Select, obj.tapCount); } protected void GestureRecognizer_HoldStarted(HoldStartedEventArgs obj) @@ -820,8 +829,8 @@ protected void NavigationGestureRecognizer_NavigationCanceled(NavigationCanceled InputManager.Instance.RaiseNavigationCanceled(this, obj.source.id); } + #endregion //Raise GestureRecognizer Events #endif - #endregion } } \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs b/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs index 66453d3b1bf..6d337a87f4a 100644 --- a/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs @@ -7,7 +7,6 @@ #if UNITY_WSA || UNITY_STANDALONE_WIN using System.Text; using UnityEngine.Windows.Speech; -using UnityEngine.XR.WSA.Input; #endif namespace HoloToolkit.Unity.InputModule @@ -255,9 +254,9 @@ private static void DictationRecognizer_DictationError(string error, int hresult #region IInputSource Implementation - public bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceKind.Voice; + sourceKind = InteractionSourceInfo.Voice; return true; } diff --git a/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs b/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs index e1ded189fe6..d74db506533 100644 --- a/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs +++ b/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs @@ -3,7 +3,6 @@ using System; using UnityEngine; -using UnityEngine.XR.WSA.Input; namespace HoloToolkit.Unity.InputModule { @@ -38,7 +37,7 @@ void IInputHandler.OnInputDown(InputEventData eventData) void IInputHandler.OnInputUp(InputEventData eventData) { - if (IsEnabled && (eventData.PressType == InteractionSourcePressType.Select)) + if (IsEnabled && eventData.PressType == InteractionSourcePressInfo.Select) { ButtonPressed.RaiseEvent(); eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers. diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs new file mode 100644 index 00000000000..2ad20135078 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace HoloToolkit.Unity.InputModule +{ + public enum InteractionSourceInfo + { + Other = 0, + Hand = 1, + Voice = 2, + Controller = 3, + } +} diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta new file mode 100644 index 00000000000..bda03797482 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: ac325f352d92177438eec1186406a398 +timeCreated: 1506471834 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs new file mode 100644 index 00000000000..9c0c40174f9 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace HoloToolkit.Unity.InputModule +{ + public enum InteractionSourcePressInfo + { + None = 0, + Select = 1, + Menu = 2, + Grasp = 3, + Touchpad = 4, + Thumbstick = 5, + } +} diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta new file mode 100644 index 00000000000..7453f186ec0 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 96ae32b2be3bb584c8e78cf777d5cbc6 +timeCreated: 1506472367 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs index a1ddf8ec8be..2a416b62d68 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs @@ -1,5 +1,8 @@ using UnityEngine; + +#if UNITY_WSA using UnityEngine.XR.WSA; +#endif namespace HoloToolkit.Unity.InputModule { @@ -52,24 +55,25 @@ public enum DisplayType private void Start() { - if (HolographicSettings.IsDisplayOpaque) - { - CurrentDisplayType = DisplayType.Opaque; - ApplySettingsForOpaqueDisplay(); - if (OnDisplayDetected != null) - { - OnDisplayDetected(DisplayType.Opaque); - } - } - else +#if UNITY_WSA + if (!HolographicSettings.IsDisplayOpaque) { CurrentDisplayType = DisplayType.Transparent; ApplySettingsForTransparentDisplay(); if (OnDisplayDetected != null) { OnDisplayDetected(DisplayType.Transparent); + return; ; } } +#endif + + CurrentDisplayType = DisplayType.Opaque; + ApplySettingsForOpaqueDisplay(); + if (OnDisplayDetected != null) + { + OnDisplayDetected(DisplayType.Opaque); + } } public void ApplySettingsForOpaqueDisplay() diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs b/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs index 897c4823961..e29cce9f360 100644 --- a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs +++ b/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs @@ -75,7 +75,7 @@ protected virtual void Start() } } - void ISpeechHandler.OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) + void ISpeechHandler.OnSpeechKeywordRecognized(SpeechEventData eventData) { UnityEvent keywordResponse; diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs b/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs index 2b0fcf49833..4263078b414 100644 --- a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs @@ -7,7 +7,6 @@ #if UNITY_WSA || UNITY_STANDALONE_WIN using UnityEngine.Windows.Speech; -using UnityEngine.XR.WSA.Input; #endif namespace HoloToolkit.Unity.InputModule @@ -49,7 +48,7 @@ public enum RecognizerStartBehavior { AutoStart, ManualStart } private KeywordRecognizer keywordRecognizer; - private SpeechKeywordRecognizedEventData speechKeywordRecognizedEventData; + private SpeechEventData speechEventData; #region Unity Methods @@ -60,7 +59,7 @@ protected override void Start() DontDestroyOnLoad(gameObject); } - speechKeywordRecognizedEventData = new SpeechKeywordRecognizedEventData(EventSystem.current); + speechEventData = new SpeechEventData(EventSystem.current); int keywordCount = Keywords.Length; if (keywordCount > 0) @@ -167,7 +166,7 @@ public void StopKeywordRecognizer() private static readonly ExecuteEvents.EventFunction OnSpeechKeywordRecognizedEventHandler = delegate (ISpeechHandler handler, BaseEventData eventData) { - SpeechKeywordRecognizedEventData casted = ExecuteEvents.ValidateEventData(eventData); + SpeechEventData casted = ExecuteEvents.ValidateEventData(eventData); handler.OnSpeechKeywordRecognized(casted); }; @@ -177,19 +176,19 @@ protected void OnPhraseRecognized(ConfidenceLevel confidence, TimeSpan phraseDur object tag = null; // Create input event - speechKeywordRecognizedEventData.Initialize(this, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); + speechEventData.Initialize(this, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); // Pass handler through HandleEvent to perform modal/fallback logic - InputManager.Instance.HandleEvent(speechKeywordRecognizedEventData, OnSpeechKeywordRecognizedEventHandler); + InputManager.Instance.HandleEvent(speechEventData, OnSpeechKeywordRecognizedEventHandler); } #endif #region Base Input Source Methods - public override bool TryGetSourceKind(uint sourceId, out InteractionSourceKind sourceKind) + public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceKind.Voice; + sourceKind = InteractionSourceInfo.Voice; return true; } diff --git a/Assets/HoloToolkit/SharingWithUNET/Scripts/PlayerController.cs b/Assets/HoloToolkit/SharingWithUNET/Scripts/PlayerController.cs index 0a8ea6302ac..cc89e52139c 100644 --- a/Assets/HoloToolkit/SharingWithUNET/Scripts/PlayerController.cs +++ b/Assets/HoloToolkit/SharingWithUNET/Scripts/PlayerController.cs @@ -32,6 +32,8 @@ public static PlayerController Instance /// public GameObject bullet; + public bool CanShareAnchors; + /// /// The transform of the shared world anchor. /// @@ -276,9 +278,11 @@ private void InitializeLocalPlayer() Debug.LogFormat("Set local player name {0} ip {1}", networkDiscovery.broadcastData, networkDiscovery.LocalIp); CmdSetPlayerName(networkDiscovery.broadcastData); CmdSetPlayerIp(networkDiscovery.LocalIp); - bool opaqueDisplay = UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque; - Debug.LogFormat("local player {0} share anchors ", (opaqueDisplay ? "does not" : "does")); - CmdSetCanShareAnchors(!opaqueDisplay); +#if UNITY_WSA + CanShareAnchors = !UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque; +#endif + Debug.LogFormat("local player {0} share anchors ", (CanShareAnchors ? "does not" : "does")); + CmdSetCanShareAnchors(CanShareAnchors); } } diff --git a/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs b/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs index 06a2af674fc..6b51c10f751 100644 --- a/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs +++ b/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs @@ -1,20 +1,19 @@ -using HoloToolkit.Unity.InputModule; -using UnityEngine; +using UnityEngine; using UnityEngine.Networking; +using HoloToolkit.Unity.InputModule; using HoloToolkit.Unity.SpatialMapping; namespace HoloToolkit.Unity.SharingWithUNET { public class UNetSharedHologram : NetworkBehaviour, IInputClickHandler { - /// /// The position relative to the shared world anchor. /// [SyncVar(hook = "xformchange")] private Vector3 localPosition; - void xformchange(Vector3 update) + private void xformchange(Vector3 update) { Debug.Log(localPosition + " xform change " + update); localPosition = update; @@ -41,16 +40,18 @@ public void CmdTransform(Vector3 postion, Quaternion rotation) } } - bool Moving = false; - int layerMask; - InputManager inputManager; + private bool Moving = false; + private int layerMask; + private InputManager inputManager; public Vector3 movementOffset = Vector3.zero; - bool isOpaque; + private bool isOpaque; // Use this for initialization - void Start() + private void Start() { +#if UNITY_WSA isOpaque = UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque; +#endif transform.SetParent(SharedCollection.Instance.transform, true); if (isServer) { @@ -64,7 +65,7 @@ void Start() } // Update is called once per frame - void Update() + private void Update() { if (Moving) @@ -79,7 +80,7 @@ void Update() } } - Vector3 ProposeTransformPosition() + private Vector3 ProposeTransformPosition() { // Put the model 3m in front of the user. Vector3 retval = Camera.main.transform.position + Camera.main.transform.forward * 3 + movementOffset; diff --git a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/ScrollingSessionListUIController.cs b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/ScrollingSessionListUIController.cs index 490adc72c16..eccd2f3d90a 100644 --- a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/ScrollingSessionListUIController.cs +++ b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/ScrollingSessionListUIController.cs @@ -4,7 +4,6 @@ using UnityEngine; using System; using System.Linq; -using HoloToolkit.Unity; namespace HoloToolkit.Unity.SharingWithUNET { @@ -26,7 +25,7 @@ public class ScrollingSessionListUIController : SingleInstance /// Keeps track of the current index that is the 'top' of the UI list - /// to enable scolling. + /// to enable scrolling. /// private int SessionIndex = 0; @@ -43,10 +42,12 @@ public class ScrollingSessionListUIController : SingleInstance().TagalongDistance = 1; } +#endif // Register for events when sessions are found / joined. networkDiscovery = NetworkDiscoveryWithAnchors.Instance; @@ -100,7 +101,7 @@ void SetChildren(bool Enabled) /// /// Updates which session is the 'top' session in the list, and sets the - /// session buttons accordinglingly + /// session buttons accordingly /// /// are we scrolling up, down, or not scrolling public void ScrollSessions(int Direction) diff --git a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs index fdc0ddade5b..fda068a8364 100644 --- a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs +++ b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs @@ -19,7 +19,7 @@ public class StartSessionButton : MonoBehaviour, IInputClickHandler void Start() { networkDiscovery = NetworkDiscoveryWithAnchors.Instance; -#if !UNITY_EDITOR +#if UNITY_WSA if (UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) { Debug.Log("Only hololens can host for now"); @@ -39,7 +39,7 @@ public void OnInputClicked(InputClickedEventData eventData) // Only let hololens host // We are also allowing the editor to host for testing purposes, but shared anchors // will currently not work in this mode. -#if !UNITY_EDITOR +#if UNITY_WSA if (!UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) #else Debug.Log("Unity editor can host, but World Anchors will not be shared"); diff --git a/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs b/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs index 25570d503a9..9d9c692625c 100644 --- a/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs +++ b/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs @@ -4,7 +4,10 @@ using System; using System.Collections.Generic; using UnityEngine; + +#if UNITY_WSA using UnityEngine.XR.WSA.Input; +#endif namespace HoloToolkit.Unity { @@ -12,7 +15,9 @@ public class DebugPanelControllerInfo : MonoBehaviour { private class ControllerState { +#if UNITY_WSA public InteractionSourceHandedness Handedness; +#endif public Vector3 PointerPosition; public Quaternion PointerRotation; public Vector3 GripPosition; @@ -78,6 +83,7 @@ private void Start() } } +#if UNITY_WSA private void InteractionManager_InteractionSourceDetected(InteractionSourceDetectedEventArgs obj) { Debug.LogFormat("{0} {1} Detected", obj.state.source.handedness, obj.state.source.kind); @@ -116,10 +122,12 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate controllerState.TouchpadPosition = obj.state.touchpadPosition; } } +#endif private string GetControllerInfo() { string toReturn = ""; +#if UNITY_WSA foreach (ControllerState controllerState in controllers.Values) { // Debug message @@ -135,7 +143,7 @@ private string GetControllerInfo() controllerState.TouchpadTouched, controllerState.TouchpadPosition); // Text label display - if(controllerState.Handedness.Equals(InteractionSourceHandedness.Left)) + if (controllerState.Handedness.Equals(InteractionSourceHandedness.Left)) { LeftInfoTextPointerPosition.text = controllerState.Handedness.ToString(); LeftInfoTextPointerRotation.text = controllerState.PointerRotation.ToString(); @@ -168,6 +176,7 @@ private string GetControllerInfo() RightInfoTextTouchpadPosition.text = controllerState.TouchpadPosition.ToString(); } } +#endif return toReturn.Substring(0, Math.Max(0, toReturn.Length - 2)); } } diff --git a/Assets/HoloToolkit/Utilities/Scripts/HeadsetAdjustment.cs b/Assets/HoloToolkit/Utilities/Scripts/HeadsetAdjustment.cs index 57e597d0348..8e209815115 100644 --- a/Assets/HoloToolkit/Utilities/Scripts/HeadsetAdjustment.cs +++ b/Assets/HoloToolkit/Utilities/Scripts/HeadsetAdjustment.cs @@ -21,7 +21,7 @@ public void OnInputClicked(InputClickedEventData eventData) GotoNextScene(); } - public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData) + public void OnSpeechKeywordRecognized(SpeechEventData eventData) { GotoNextScene(); } From b54634006d7b3a6a63e63f019b8f918cc0e291ab Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 26 Sep 2017 20:04:03 -0700 Subject: [PATCH 13/25] removed extra semi colon. --- .../Input/Scripts/Utilities/MixedRealityCameraManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs index 2a416b62d68..f325690d4d1 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs @@ -63,7 +63,7 @@ private void Start() if (OnDisplayDetected != null) { OnDisplayDetected(DisplayType.Transparent); - return; ; + return; } } #endif @@ -99,4 +99,4 @@ private static void SetQuality(int level) QualitySettings.SetQualityLevel(level, false); } } -} \ No newline at end of file +} From d4f8d97e6b25d9d3c9f96bcc7823c6728894ac4b Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 10:09:53 -0700 Subject: [PATCH 14/25] More updates to the InputManger. Upated tag reference to tags and made it an object array. --- .../HoloToolkit/Input/Scripts/InputManager.cs | 108 +++++++++--------- .../Scripts/InputSources/EditorInputSource.cs | 2 +- .../InputSources/GamePadInputSource.cs | 4 +- .../Scripts/InputSources/GamepadInput.cs | 2 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/InputManager.cs index 81f3828a88c..45a60ffb57a 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputManager.cs @@ -396,10 +396,10 @@ public void HandleEvent(BaseEventData eventData, ExecuteEvents.EventFunction< handler.OnInputClicked(casted); }; - public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, int tapCount, object tag = null) + public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, int tapCount, object[] tags = null) { // Create input event - sourceClickedEventData.Initialize(source, sourceId, tag, pressType, tapCount); + sourceClickedEventData.Initialize(source, sourceId, tags, pressType, tapCount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourceClickedEventData, OnInputClickedEventHandler); @@ -414,10 +414,10 @@ public void RaiseInputClicked(IInputSource source, uint sourceId, InteractionSou handler.OnInputUp(casted); }; - public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object tag = null) + public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object[] tags = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, pressType); + inputEventData.Initialize(source, sourceId, tags, pressType); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnSourceUpEventHandler); @@ -441,10 +441,10 @@ public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionSourceP handler.OnInputDown(casted); }; - public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object tag = null) + public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, object[] tags = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, pressType); + inputEventData.Initialize(source, sourceId, tags, pressType); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnSourceDownEventHandler); @@ -478,7 +478,7 @@ public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionSourc handler.OnSourceDetected(casted); }; - public void RaiseSourceDetected(IInputSource source, uint sourceId, object tag = null) + public void RaiseSourceDetected(IInputSource source, uint sourceId, object[] tags = null) { // Manage list of detected sources bool alreadyDetected = false; @@ -498,7 +498,7 @@ public void RaiseSourceDetected(IInputSource source, uint sourceId, object tag = } // Create input event - sourceStateEventData.Initialize(source, sourceId, tag); + sourceStateEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourceStateEventData, OnSourceDetectedEventHandler); @@ -511,7 +511,7 @@ public void RaiseSourceDetected(IInputSource source, uint sourceId, object tag = handler.OnSourceLost(casted); }; - public void RaiseSourceLost(IInputSource source, uint sourceId, object tag = null) + public void RaiseSourceLost(IInputSource source, uint sourceId, object[] tags = null) { // Manage list of detected sources for (int iDetected = 0; iDetected < detectedInputSources.Count; iDetected++) @@ -524,7 +524,7 @@ public void RaiseSourceLost(IInputSource source, uint sourceId, object tag = nul } // Create input event - sourceStateEventData.Initialize(source, sourceId, tag); + sourceStateEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourceStateEventData, OnSourceLostEventHandler); @@ -541,10 +541,10 @@ public void RaiseSourceLost(IInputSource source, uint sourceId, object tag = nul handler.OnManipulationStarted(casted); }; - public void RaiseManipulationStarted(IInputSource source, uint sourceId, object tag = null) + public void RaiseManipulationStarted(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - manipulationEventData.Initialize(source, sourceId, tag, Vector3.zero); + manipulationEventData.Initialize(source, sourceId, tags, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationStartedEventHandler); @@ -557,10 +557,10 @@ public void RaiseManipulationStarted(IInputSource source, uint sourceId, object handler.OnManipulationUpdated(casted); }; - public void RaiseManipulationUpdated(IInputSource source, uint sourceId, Vector3 cumulativeDelta, object tag = null) + public void RaiseManipulationUpdated(IInputSource source, uint sourceId, Vector3 cumulativeDelta, object[] tags = null) { // Create input event - manipulationEventData.Initialize(source, sourceId, tag, cumulativeDelta); + manipulationEventData.Initialize(source, sourceId, tags, cumulativeDelta); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationUpdatedEventHandler); @@ -573,10 +573,10 @@ public void RaiseManipulationUpdated(IInputSource source, uint sourceId, Vector3 handler.OnManipulationCompleted(casted); }; - public void RaiseManipulationCompleted(IInputSource source, uint sourceId, Vector3 cumulativeDelta, object tag = null) + public void RaiseManipulationCompleted(IInputSource source, uint sourceId, Vector3 cumulativeDelta, object[] tags = null) { // Create input event - manipulationEventData.Initialize(source, sourceId, tag, cumulativeDelta); + manipulationEventData.Initialize(source, sourceId, tags, cumulativeDelta); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationCompletedEventHandler); @@ -589,10 +589,10 @@ public void RaiseManipulationCompleted(IInputSource source, uint sourceId, Vecto handler.OnManipulationCanceled(casted); }; - public void RaiseManipulationCanceled(IInputSource source, uint sourceId, object tag = null) + public void RaiseManipulationCanceled(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - manipulationEventData.Initialize(source, sourceId, tag, Vector3.zero); + manipulationEventData.Initialize(source, sourceId, tags, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationCanceledEventHandler); @@ -609,10 +609,10 @@ public void RaiseManipulationCanceled(IInputSource source, uint sourceId, object handler.OnHoldStarted(casted); }; - public void RaiseHoldStarted(IInputSource source, uint sourceId, object tag = null) + public void RaiseHoldStarted(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - holdEventData.Initialize(source, sourceId, tag); + holdEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(holdEventData, OnHoldStartedEventHandler); @@ -625,10 +625,10 @@ public void RaiseHoldStarted(IInputSource source, uint sourceId, object tag = nu handler.OnHoldCompleted(casted); }; - public void RaiseHoldCompleted(IInputSource source, uint sourceId, object tag = null) + public void RaiseHoldCompleted(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - holdEventData.Initialize(source, sourceId, tag); + holdEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(holdEventData, OnHoldCompletedEventHandler); @@ -641,10 +641,10 @@ public void RaiseHoldCompleted(IInputSource source, uint sourceId, object tag = handler.OnHoldCanceled(casted); }; - public void RaiseHoldCanceled(IInputSource source, uint sourceId, object tag = null) + public void RaiseHoldCanceled(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - holdEventData.Initialize(source, sourceId, tag); + holdEventData.Initialize(source, sourceId, tags); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(holdEventData, OnHoldCanceledEventHandler); @@ -661,10 +661,10 @@ public void RaiseHoldCanceled(IInputSource source, uint sourceId, object tag = n handler.OnNavigationStarted(casted); }; - public void RaiseNavigationStarted(IInputSource source, uint sourceId, object tag = null) + public void RaiseNavigationStarted(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - navigationEventData.Initialize(source, sourceId, tag, Vector3.zero); + navigationEventData.Initialize(source, sourceId, tags, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationStartedEventHandler); @@ -677,10 +677,10 @@ public void RaiseNavigationStarted(IInputSource source, uint sourceId, object ta handler.OnNavigationUpdated(casted); }; - public void RaiseNavigationUpdated(IInputSource source, uint sourceId, Vector3 normalizedOffset, object tag = null) + public void RaiseNavigationUpdated(IInputSource source, uint sourceId, Vector3 normalizedOffset, object[] tags = null) { // Create input event - navigationEventData.Initialize(source, sourceId, tag, normalizedOffset); + navigationEventData.Initialize(source, sourceId, tags, normalizedOffset); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationUpdatedEventHandler); @@ -693,10 +693,10 @@ public void RaiseNavigationUpdated(IInputSource source, uint sourceId, Vector3 n handler.OnNavigationCompleted(casted); }; - public void RaiseNavigationCompleted(IInputSource source, uint sourceId, Vector3 normalizedOffset, object tag = null) + public void RaiseNavigationCompleted(IInputSource source, uint sourceId, Vector3 normalizedOffset, object[] tags = null) { // Create input event - navigationEventData.Initialize(source, sourceId, tag, normalizedOffset); + navigationEventData.Initialize(source, sourceId, tags, normalizedOffset); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationCompletedEventHandler); @@ -709,10 +709,10 @@ public void RaiseNavigationCompleted(IInputSource source, uint sourceId, Vector3 handler.OnNavigationCanceled(casted); }; - public void RaiseNavigationCanceled(IInputSource source, uint sourceId, object tag = null) + public void RaiseNavigationCanceled(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - navigationEventData.Initialize(source, sourceId, tag, Vector3.zero); + navigationEventData.Initialize(source, sourceId, tags, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationCanceledEventHandler); @@ -729,10 +729,10 @@ public void RaiseNavigationCanceled(IInputSource source, uint sourceId, object t handler.OnInputPositionChanged(casted); }; - public void RaiseInputPositionChanged(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, Vector2 position, object tag = null) + public void RaiseInputPositionChanged(IInputSource source, uint sourceId, InteractionSourcePressInfo pressType, Vector2 position, object[] tags = null) { // Create input event - inputPositionEventData.Initialize(source, sourceId, tag, pressType, position); + inputPositionEventData.Initialize(source, sourceId, tags, pressType, position); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPositionEventData, OnInputPositionChangedEventHandler); @@ -745,10 +745,10 @@ public void RaiseInputPositionChanged(IInputSource source, uint sourceId, Intera handler.OnSelectPressedAmountChanged(casted); }; - public void RaiseSelectPressedAmountChanged(IInputSource source, uint sourceId, double pressedAmount, object tag = null) + public void RaiseSelectPressedAmountChanged(IInputSource source, uint sourceId, double pressedAmount, object[] tags = null) { // Create input event - selectPressedEventData.Initialize(source, sourceId, tag, pressedAmount); + selectPressedEventData.Initialize(source, sourceId, tags, pressedAmount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(selectPressedEventData, OnSelectPressedAmountChangedEventHandler); @@ -761,10 +761,10 @@ public void RaiseSelectPressedAmountChanged(IInputSource source, uint sourceId, handler.OnTouchpadTouched(casted); }; - public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object tag = null) + public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressInfo.Touchpad); + inputEventData.Initialize(source, sourceId, tags, InteractionSourcePressInfo.Touchpad); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnTouchpadTouchedEventHandler); @@ -777,10 +777,10 @@ public void RaiseTouchpadTouched(IInputSource source, uint sourceId, object tag handler.OnTouchpadReleased(casted); }; - public void RaiseTouchpadReleased(IInputSource source, uint sourceId, object tag = null) + public void RaiseTouchpadReleased(IInputSource source, uint sourceId, object[] tags = null) { // Create input event - inputEventData.Initialize(source, sourceId, tag, InteractionSourcePressInfo.Touchpad); + inputEventData.Initialize(source, sourceId, tags, InteractionSourcePressInfo.Touchpad); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnTouchpadReleasedEventHandler); @@ -793,10 +793,10 @@ public void RaiseTouchpadReleased(IInputSource source, uint sourceId, object tag handler.OnPositionChanged(casted); }; - public void RaiseSourcePositionChanged(IInputSource source, uint sourceId, Vector3 pointerPosition, Vector3 gripPosition, object tag = null) + public void RaiseSourcePositionChanged(IInputSource source, uint sourceId, Vector3 pointerPosition, Vector3 gripPosition, object[] tags = null) { // Create input event - sourcePositionEventData.Initialize(source, sourceId, tag, pointerPosition, gripPosition); + sourcePositionEventData.Initialize(source, sourceId, tags, pointerPosition, gripPosition); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourcePositionEventData, OnSourcePositionChangedEventHandler); @@ -809,10 +809,10 @@ public void RaiseSourcePositionChanged(IInputSource source, uint sourceId, Vecto handler.OnRotationChanged(casted); }; - public void RaiseSourceRotationChanged(IInputSource source, uint sourceId, Quaternion pointerRotation, Quaternion gripRotation, object tag = null) + public void RaiseSourceRotationChanged(IInputSource source, uint sourceId, Quaternion pointerRotation, Quaternion gripRotation, object[] tags = null) { // Create input event - sourceRotationEventData.Initialize(source, sourceId, tag, pointerRotation, gripRotation); + sourceRotationEventData.Initialize(source, sourceId, tags, pointerRotation, gripRotation); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(sourceRotationEventData, OnSourceRotationChangedEventHandler); @@ -886,10 +886,10 @@ public void RaiseXboxInputUpdate(IInputSource source, uint sourceId, XboxControl handler.OnSpeechKeywordRecognized(casted); }; - public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string text, object tag = null) + public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceId, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string text, object[] tags = null) { // Create input event - speechEventData.Initialize(source, sourceId, tag, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); + speechEventData.Initialize(source, sourceId, tags, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(speechEventData, OnSpeechKeywordRecognizedEventHandler); @@ -902,10 +902,10 @@ public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceI handler.OnDictationHypothesis(casted); }; - public void RaiseDictationHypothesis(IInputSource source, uint sourceId, string dictationHypothesis, AudioClip dictationAudioClip = null, object tag = null) + public void RaiseDictationHypothesis(IInputSource source, uint sourceId, string dictationHypothesis, AudioClip dictationAudioClip = null, object[] tags = null) { // Create input event - dictationEventData.Initialize(source, sourceId, tag, dictationHypothesis, dictationAudioClip); + dictationEventData.Initialize(source, sourceId, tags, dictationHypothesis, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationHypothesisEventHandler); @@ -918,10 +918,10 @@ public void RaiseDictationHypothesis(IInputSource source, uint sourceId, string handler.OnDictationResult(casted); }; - public void RaiseDictationResult(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip = null, object tag = null) + public void RaiseDictationResult(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null) { // Create input event - dictationEventData.Initialize(source, sourceId, tag, dictationResult, dictationAudioClip); + dictationEventData.Initialize(source, sourceId, tags, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationResultEventHandler); @@ -934,10 +934,10 @@ public void RaiseDictationResult(IInputSource source, uint sourceId, string dict handler.OnDictationComplete(casted); }; - public void RaiseDictationComplete(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip, object tag = null) + public void RaiseDictationComplete(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip, object[] tags = null) { // Create input event - dictationEventData.Initialize(source, sourceId, tag, dictationResult, dictationAudioClip); + dictationEventData.Initialize(source, sourceId, tags, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationCompleteEventHandler); @@ -950,10 +950,10 @@ public void RaiseDictationComplete(IInputSource source, uint sourceId, string di handler.OnDictationError(casted); }; - public void RaiseDictationError(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip = null, object tag = null) + public void RaiseDictationError(IInputSource source, uint sourceId, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null) { // Create input event - dictationEventData.Initialize(source, sourceId, tag, dictationResult, dictationAudioClip); + dictationEventData.Initialize(source, sourceId, tags, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationErrorEventHandler); diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs index fc76415afa0..d3110a66e83 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs @@ -451,7 +451,7 @@ private void SendControllerStateEvents(float time) CurrentButtonStates.HoldInProgress = false; } - InputManager.Instance.RaiseManipulationStarted(this, controllerId, CurrentButtonStates.CumulativeDelta); + InputManager.Instance.RaiseManipulationStarted(this, controllerId); CurrentButtonStates.ManipulationInProgress = true; } // Holds are triggered by time. diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs index 45e27653417..8ace308887a 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GamePadInputSource.cs @@ -8,7 +8,7 @@ namespace HoloToolkit.Unity.InputModule public class GamePadInputSource : BaseInputSource { [SerializeField] - [Tooltip("Time in secords to determine if an Input Device has been connected or disconnected")] + [Tooltip("Time in seconds to determine if an Input Device has been connected or disconnected")] protected float DeviceRefreshInterval = 3.0f; protected float DeviceRefreshTimer; protected int LastDeviceUpdateCount; @@ -46,7 +46,7 @@ protected virtual void RefreshDevices() public override bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind) { - sourceKind = InteractionSourceInfo.Voice; + sourceKind = InteractionSourceInfo.Controller; return true; } diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs index bcd01325d25..46b93b78905 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GamepadInput.cs @@ -144,7 +144,7 @@ private void HandleNavigation() currentGestureState = GestureState.NavigationStarted; navigationStarted = true; // Raise navigation started event. - inputManager.RaiseNavigationStarted(this, GamePadId, normalizedOffset); + inputManager.RaiseNavigationStarted(this, GamePadId); } // Raise navigation updated event. From 9857547e73ef9c0df17d47809ca19423193e21d7 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 12:10:13 -0700 Subject: [PATCH 15/25] Input/Scripts folder organization --- .../Scripts/GameControllerManipulator.cs | 166 ------------------ .../Scripts/GameControllerManipulator.cs.meta | 12 -- .../Input/Scripts/InputEvents.meta | 10 -- .../IControllerInputHandler.cs | 0 .../IControllerInputHandler.cs.meta | 0 .../IControllerTouchpadHandler.cs | 0 .../IControllerTouchpadHandler.cs.meta | 0 .../IPointerSpecificFocusable.cs | 0 .../IPointerSpecificFocusable.cs.meta | 0 .../ISelectHandler.cs | 0 .../ISelectHandler.cs.meta | 0 .../ISourcePositionHandler.cs | 0 .../ISourcePositionHandler.cs.meta | 0 .../ISourceRotationHandler.cs | 0 .../ISourceRotationHandler.cs.meta | 0 .../SpeechInputSource.cs | 0 .../SpeechInputSource.cs.meta | 0 .../Scripts/{ => Utilities}/ControllerInfo.cs | 0 .../{ => Utilities}/ControllerInfo.cs.meta | 0 .../{ => Utilities}/ControllerVisualizer.cs | 0 .../ControllerVisualizer.cs.meta | 0 .../{ => Utilities}/EditorInputSelector.cs | 0 .../EditorInputSelector.cs.meta | 0 .../Scripts/{ => Utilities}/InputManager.cs | 0 .../{ => Utilities}/InputManager.cs.meta | 0 .../{ => Utilities}/KeyboardManager.cs | 0 .../{ => Utilities}/KeyboardManager.cs.meta | 0 .../{Voice => Utilities}/KeywordAndKeyCode.cs | 0 .../KeywordAndKeyCode.cs.meta | 0 .../{Voice => Utilities}/KeywordManager.cs | 0 .../KeywordManager.cs.meta | 0 .../MixedRealityTeleport.cs | 0 .../MixedRealityTeleport.cs.meta | 0 .../SpeechInputHandler.cs | 0 .../SpeechInputHandler.cs.meta | 0 Assets/HoloToolkit/Input/Scripts/Voice.meta | 9 - 36 files changed, 197 deletions(-) delete mode 100644 Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs delete mode 100644 Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs.meta delete mode 100644 Assets/HoloToolkit/Input/Scripts/InputEvents.meta rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IControllerInputHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IControllerInputHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IControllerTouchpadHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IControllerTouchpadHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IPointerSpecificFocusable.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/IPointerSpecificFocusable.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISelectHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISelectHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISourcePositionHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISourcePositionHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISourceRotationHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{InputEvents => InputHandlers}/ISourceRotationHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => InputSources}/SpeechInputSource.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => InputSources}/SpeechInputSource.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/ControllerInfo.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/ControllerInfo.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/ControllerVisualizer.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/ControllerVisualizer.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/EditorInputSelector.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/EditorInputSelector.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/InputManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/InputManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/KeyboardManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/KeyboardManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/KeywordAndKeyCode.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/KeywordAndKeyCode.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/KeywordManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/KeywordManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Gaze => Utilities}/MixedRealityTeleport.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Gaze => Utilities}/MixedRealityTeleport.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/SpeechInputHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Voice => Utilities}/SpeechInputHandler.cs.meta (100%) delete mode 100644 Assets/HoloToolkit/Input/Scripts/Voice.meta diff --git a/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs b/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs deleted file mode 100644 index 4c450119d05..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using UnityEngine; - -namespace HoloToolkit.Unity.InputModule -{ - /// - /// Allows the user to place and rotate GameObjects using a game controller. - /// For a more complete gamepad control script refer to GamepadInput.cs and MixedRealityTeleport.cs - /// - /// Make sure to enable the capability on HoloLens Platform ONLY. Enabling this capability on the PC or Xbox targets will break input. - [Obsolete("Please use XboxControllerInputSource")] - public class GameControllerManipulator : MonoBehaviour - { - [Tooltip("Name of the joystick axis that moves the object along X as set in InputManager")] - public string MoveXAxisName = "ControllerLeftStickX"; - [Tooltip("Speed of movement along X")] - public float MoveXAxisSpeed = 0.2f; - - [Tooltip("Name of the joystick axis that moves the object along Y as set in InputManager")] - public string MoveYAxisName = "ControllerLeftStickY"; - [Tooltip("Speed of movement along Y")] - public float MoveYAxisSpeed = 0.2f; - - [Tooltip("Name of the joystick axis that moves the object along Z as set in InputManager")] - public string MoveZAxisName = "ControllerTriggerAxis"; - [Tooltip("Speed of movement along Z")] - public float MoveZAxisSpeed = 0.2f; - - [Tooltip("Name of the button the user presses to move the object with gaze")] - public string MoveWithGazeButtonName = "Fire1"; - - [Tooltip("Name of the joystick axis that rotates around X as set in InputManager")] - public string RotateAroundXAxisName = "ControllerLeftStickY"; - [Tooltip("Speed of rotation around X")] - public float RotateAroundXAxisSpeed = -1f; - - [Tooltip("Name of the joystick axis that rotates around Y as set in InputManager")] - public string RotateAroundYAxisName = "ControllerLeftStickX"; - [Tooltip("Speed of rotation around Y")] - public float RotateAroundYAxisSpeed = -1f; - - [Tooltip("Name of the joystick axis that rotates around Z as set in InputManager")] - public string RotateAroundZAxisName = ""; - [Tooltip("Speed of rotation around Z")] - public float RotateAroundZAxisSpeed = 1f; - - [Tooltip("Name of the button used to enable rotation. Useful for single stick controllers")] - public string RotateModifierButtonName = "Fire2"; - - [Tooltip("Move the gaze target instead of the GameObject this script is attached to")] - public bool MoveGazeTarget = false; - - private GameObject lastAffectedObject; - private float stickDistance = 0; - - // Update is called once per frame - private void Update() - { - GameObject objectToManipulate; - - if (!MoveGazeTarget) - { - objectToManipulate = gameObject; - } - else - { - objectToManipulate = lastAffectedObject ?? GazeManager.Instance.HitObject; - } - - if (objectToManipulate == null) - { - return; - } - - var cameraTransform = CameraCache.Main.transform; - - //Rotate - var noRotateModifier = string.IsNullOrEmpty(RotateModifierButtonName); - var enableRotate = noRotateModifier || Input.GetButton(RotateModifierButtonName); - - float rz = 0; - float ry = 0; - float rx = 0; - - if (enableRotate) - { - rz = RotateAroundAxis(objectToManipulate, RotateAroundZAxisName, cameraTransform.forward, RotateAroundZAxisSpeed); - ry = RotateAroundAxis(objectToManipulate, RotateAroundYAxisName, cameraTransform.up, RotateAroundYAxisSpeed); - rx = RotateAroundAxis(objectToManipulate, RotateAroundXAxisName, cameraTransform.right, RotateAroundXAxisSpeed); - } - - //Move - bool usingSameAxisForRotateAndMove = RotateAroundYAxisName == MoveXAxisName || - RotateAroundYAxisName == MoveZAxisName || - RotateAroundZAxisName == MoveXAxisName || - RotateAroundZAxisName == MoveYAxisName; - - float x = 0; - float y = 0; - - //only move if the movement axis has not been used for rotation - if (!(enableRotate && usingSameAxisForRotateAndMove)) - { - x = Input.GetAxis(MoveXAxisName) * MoveXAxisSpeed * 60 * Time.deltaTime; - objectToManipulate.transform.RotateAround(cameraTransform.position, cameraTransform.up, x); - - y = Input.GetAxis(MoveYAxisName) * MoveYAxisSpeed * 60 * Time.deltaTime; - objectToManipulate.transform.RotateAround(cameraTransform.position, cameraTransform.right, y); - } - - var z = Input.GetAxis(MoveZAxisName) * MoveZAxisSpeed * 60 * Time.deltaTime; - objectToManipulate.transform.position += cameraTransform.forward*z*-0.03f; - - var stickInFrontOfMe = Input.GetButton(MoveWithGazeButtonName); - - if (stickInFrontOfMe) - { - if (stickDistance == 0) - { - stickDistance = (objectToManipulate.transform.position - cameraTransform.position).magnitude; - } - - objectToManipulate.transform.position = cameraTransform.position + cameraTransform.forward * stickDistance; - } - else - { - stickDistance = 0; - } - - - if (stickInFrontOfMe || x != 0 || y != 0 || z != 0 || rz != 0 || ry != 0 || rx != 0) - { - lastAffectedObject = objectToManipulate; - } -#if !UNITY_EDITOR - else - { - lastAffectedObject = null; //easier to test in Unity this way - } -#endif - } - - /// - /// Rotates the specified GameObject as dictated by joystick values and multipliers - /// - /// the gameObject to rotate - /// the name of the joystick axis - /// vector to rotate around - /// rotation speed - /// the amount of rotation applied - private float RotateAroundAxis(GameObject objectToRotate, string joyAxisName, Vector3 vectorToRotateAround, float speed) - { - if (string.IsNullOrEmpty(joyAxisName)) - { - return 0; - } - - var result = Input.GetAxis(joyAxisName) * speed * 60 * Time.deltaTime; - objectToRotate.transform.rotation = Quaternion.Euler(vectorToRotateAround * result) * objectToRotate.transform.rotation; - return result; - } - } -} diff --git a/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs.meta b/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs.meta deleted file mode 100644 index 9b9eae5a900..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/GameControllerManipulator.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a4d43a912ea5ac9408a3e9d407d36b53 -timeCreated: 1472832956 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents.meta b/Assets/HoloToolkit/Input/Scripts/InputEvents.meta deleted file mode 100644 index 2fdd0cded33..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/InputEvents.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 9660420db2c085246ad4af96397bd31c -folderAsset: yes -timeCreated: 1470933856 -licenseType: Pro -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerInputHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerInputHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerInputHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerInputHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerInputHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerInputHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerInputHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerInputHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerTouchpadHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerTouchpadHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerTouchpadHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerTouchpadHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerTouchpadHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerTouchpadHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IControllerTouchpadHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IControllerTouchpadHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IPointerSpecificFocusable.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IPointerSpecificFocusable.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IPointerSpecificFocusable.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IPointerSpecificFocusable.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/IPointerSpecificFocusable.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/IPointerSpecificFocusable.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/IPointerSpecificFocusable.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/IPointerSpecificFocusable.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISelectHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISelectHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISelectHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISelectHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISelectHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISelectHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISelectHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISelectHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourcePositionHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourcePositionHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISourcePositionHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourcePositionHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourcePositionHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourcePositionHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISourcePositionHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourcePositionHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceRotationHandler.cs b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourceRotationHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceRotationHandler.cs rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourceRotationHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceRotationHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourceRotationHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputEvents/ISourceRotationHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputHandlers/ISourceRotationHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/SpeechInputSource.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/SpeechInputSource.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/SpeechInputSource.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/SpeechInputSource.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/ControllerInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/ControllerInfo.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs diff --git a/Assets/HoloToolkit/Input/Scripts/ControllerInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/ControllerInfo.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/ControllerVisualizer.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerVisualizer.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/ControllerVisualizer.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/ControllerVisualizer.cs diff --git a/Assets/HoloToolkit/Input/Scripts/ControllerVisualizer.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerVisualizer.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/ControllerVisualizer.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/ControllerVisualizer.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/EditorInputSelector.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/EditorInputSelector.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs diff --git a/Assets/HoloToolkit/Input/Scripts/EditorInputSelector.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/EditorInputSelector.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/InputManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/KeyboardManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/KeyboardManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/KeyboardManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/KeyboardManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/KeywordManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Gaze/MixedRealityTeleport.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Voice.meta b/Assets/HoloToolkit/Input/Scripts/Voice.meta deleted file mode 100644 index d95dcd40385..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/Voice.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1e1644ee9122f0947bb1a04f2da54d79 -folderAsset: yes -timeCreated: 1464209698 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: From 218fe04c6219b9470bfddf1b6b57a0287d00ba0c Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 12:35:43 -0700 Subject: [PATCH 16/25] A bit more organization. Minor changes. --- .../DictationInputManager.cs | 0 .../DictationInputManager.cs.meta | 0 .../InputSources/IInputSourceInfoProvider.cs | 15 +++++++++++++++ .../InputSources/IInputSourceInfoProvider.cs.meta | 13 +++++++++++++ .../InputSourceInfo.cs | 15 +-------------- .../InputSourceInfo.cs.meta | 0 .../InteractionSourceInfo.cs | 0 .../InteractionSourceInfo.cs.meta | 0 .../InteractionSourcePressInfo.cs | 0 .../InteractionSourcePressInfo.cs.meta | 0 .../Scripts/{ => Utilities}/Interactions.meta | 0 .../{ => Interactions}/EditorInputControl.cs | 0 .../{ => Interactions}/EditorInputControl.cs.meta | 0 .../{ => Interactions}/EditorInputSelector.cs | 0 .../EditorInputSelector.cs.meta | 0 .../{ => Utilities}/Interactions/HandDraggable.cs | 0 .../Interactions/HandDraggable.cs.meta | 0 .../{ => Interactions}/ManualGazeControl.cs | 0 .../{ => Interactions}/ManualGazeControl.cs.meta | 0 .../{ => Interactions}/SpeechInputHandler.cs | 0 .../{ => Interactions}/SpeechInputHandler.cs.meta | 0 .../{ => Utilities}/Interactions/TapToPlace.cs | 0 .../Interactions/TapToPlace.cs.meta | 0 .../Interactions}/TriggerButton.cs | 0 .../Interactions}/TriggerButton.cs.meta | 0 .../Scripts/{UI.meta => Utilities/Managers.meta} | 5 +++-- .../Utilities/{ => Managers}/HandGuidance.cs | 0 .../Utilities/{ => Managers}/HandGuidance.cs.meta | 0 .../Utilities/{ => Managers}/InputManager.cs | 0 .../Utilities/{ => Managers}/InputManager.cs.meta | 0 .../Utilities/{ => Managers}/KeyboardManager.cs | 0 .../{ => Managers}/KeyboardManager.cs.meta | 0 .../Utilities/{ => Managers}/KeywordManager.cs | 0 .../{ => Managers}/KeywordManager.cs.meta | 0 .../{ => Managers}/MixedRealityCameraManager.cs | 0 .../MixedRealityCameraManager.cs.meta | 0 .../{ => Managers}/MixedRealityTeleport.cs | 0 .../{ => Managers}/MixedRealityTeleport.cs.meta | 0 .../Input/Scripts/Utilities/SetGlobalListener.cs | 2 -- .../Input/Scripts/{Microphone.meta => Voice.meta} | 0 .../{Utilities => Voice}/KeywordAndKeyCode.cs | 0 .../KeywordAndKeyCode.cs.meta | 0 .../Scripts/{Microphone => Voice}/MicStream.cs | 0 .../{Microphone => Voice}/MicStream.cs.meta | 0 44 files changed, 32 insertions(+), 18 deletions(-) rename Assets/HoloToolkit/Input/Scripts/{Microphone => InputSources}/DictationInputManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Microphone => InputSources}/DictationInputManager.cs.meta (100%) create mode 100644 Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs create mode 100644 Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs.meta rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InputSourceInfo.cs (75%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InputSourceInfo.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InteractionSourceInfo.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InteractionSourceInfo.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InteractionSourcePressInfo.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => InputSources}/InteractionSourcePressInfo.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/EditorInputControl.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/EditorInputControl.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/EditorInputSelector.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/EditorInputSelector.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions/HandDraggable.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions/HandDraggable.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/ManualGazeControl.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/ManualGazeControl.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/SpeechInputHandler.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Interactions}/SpeechInputHandler.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions/TapToPlace.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{ => Utilities}/Interactions/TapToPlace.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{UI => Utilities/Interactions}/TriggerButton.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{UI => Utilities/Interactions}/TriggerButton.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{UI.meta => Utilities/Managers.meta} (60%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/HandGuidance.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/HandGuidance.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/InputManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/InputManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/KeyboardManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/KeyboardManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/KeywordManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/KeywordManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/MixedRealityCameraManager.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/MixedRealityCameraManager.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/MixedRealityTeleport.cs (100%) rename Assets/HoloToolkit/Input/Scripts/Utilities/{ => Managers}/MixedRealityTeleport.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Microphone.meta => Voice.meta} (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => Voice}/KeywordAndKeyCode.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Utilities => Voice}/KeywordAndKeyCode.cs.meta (100%) rename Assets/HoloToolkit/Input/Scripts/{Microphone => Voice}/MicStream.cs (100%) rename Assets/HoloToolkit/Input/Scripts/{Microphone => Voice}/MicStream.cs.meta (100%) diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/DictationInputManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/DictationInputManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/DictationInputManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone/DictationInputManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/DictationInputManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs new file mode 100644 index 00000000000..f064cdc2ba0 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace HoloToolkit.Unity.InputModule +{ + /// + /// IInputSourceInfoProvider gives you the input source like hands or motion controller. + /// It will also report the source id for that source. + /// + public interface IInputSourceInfoProvider + { + IInputSource InputSource { get; } + uint SourceId { get; } + } +} \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs.meta new file mode 100644 index 00000000000..a4c551db84c --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSourceInfoProvider.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9dab31032be6bc94ba022d3ae2a69112 +timeCreated: 1506540750 +licenseType: Pro +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs similarity index 75% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs index 0417a694a0a..13f8a4988dd 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs @@ -1,16 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using System; - namespace HoloToolkit.Unity.InputModule { /// /// InputSourceInfo gives you the input source like hands or motion controller. /// It will also report the source id for that source. /// - public struct InputSourceInfo : - IInputSourceInfoProvider + public struct InputSourceInfo : IInputSourceInfoProvider { public IInputSource InputSource; public uint SourceId; @@ -42,14 +39,4 @@ public bool Matches(IInputSource otherInputSource, uint otherSourceId) return ((InputSource == otherInputSource) && (SourceId == otherSourceId)); } } - - /// - /// IInputSourceInfoProvider gives you the input source like hands or motion controller. - /// It will also report the source id for that source. - /// - public interface IInputSourceInfoProvider - { - IInputSource InputSource { get; } - uint SourceId { get; } - } } diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/InputSourceInfo.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInfo.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInfo.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInfo.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourceInfo.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInfo.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourcePressInfo.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs rename to Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourcePressInfo.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourcePressInfo.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InteractionSourcePressInfo.cs.meta rename to Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourcePressInfo.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputControl.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputControl.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputControl.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputControl.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputControl.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputControl.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputControl.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputControl.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/EditorInputSelector.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions/HandDraggable.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/HandDraggable.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions/HandDraggable.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/HandDraggable.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions/HandDraggable.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/HandDraggable.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions/HandDraggable.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/HandDraggable.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/ManualGazeControl.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/ManualGazeControl.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/ManualGazeControl.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/ManualGazeControl.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/SpeechInputHandler.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/SpeechInputHandler.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/SpeechInputHandler.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/SpeechInputHandler.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/SpeechInputHandler.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TapToPlace.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TapToPlace.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TapToPlace.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TapToPlace.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TriggerButton.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TriggerButton.cs diff --git a/Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TriggerButton.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/UI/TriggerButton.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/TriggerButton.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/UI.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers.meta similarity index 60% rename from Assets/HoloToolkit/Input/Scripts/UI.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers.meta index 47ec4c38888..0cf9cfa2133 100644 --- a/Assets/HoloToolkit/Input/Scripts/UI.meta +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers.meta @@ -1,9 +1,10 @@ fileFormatVersion: 2 -guid: db8878df5857f754aafe6c6d0e759c69 +guid: 48bb2e829317e7844a9a4162b2ce8112 folderAsset: yes -timeCreated: 1469832109 +timeCreated: 1506540383 licenseType: Pro DefaultImporter: + externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/HandGuidance.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/HandGuidance.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/HandGuidance.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/HandGuidance.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/HandGuidance.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/HandGuidance.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/HandGuidance.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/HandGuidance.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/InputManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeyboardManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeyboardManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeyboardManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeyboardManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeyboardManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeywordManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityCameraManager.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityCameraManager.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityCameraManager.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityCameraManager.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityCameraManager.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/MixedRealityTeleport.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/SetGlobalListener.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/SetGlobalListener.cs index 22e2a20eedc..77cbda8c3af 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/SetGlobalListener.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/SetGlobalListener.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using UnityEngine; - namespace HoloToolkit.Unity.InputModule { /// diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone.meta b/Assets/HoloToolkit/Input/Scripts/Voice.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone.meta rename to Assets/HoloToolkit/Input/Scripts/Voice.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs b/Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs rename to Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs.meta b/Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Utilities/KeywordAndKeyCode.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Voice/KeywordAndKeyCode.cs.meta diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs b/Assets/HoloToolkit/Input/Scripts/Voice/MicStream.cs similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs rename to Assets/HoloToolkit/Input/Scripts/Voice/MicStream.cs diff --git a/Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs.meta b/Assets/HoloToolkit/Input/Scripts/Voice/MicStream.cs.meta similarity index 100% rename from Assets/HoloToolkit/Input/Scripts/Microphone/MicStream.cs.meta rename to Assets/HoloToolkit/Input/Scripts/Voice/MicStream.cs.meta From cb11ca9c0d1ee50bbae66708d640f42ac1d8230d Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 14:45:53 -0700 Subject: [PATCH 17/25] A couple more updates to the WSA wrapping, and better handling of destruction of helper scripts if in Editor and occluded. --- .../Boundary/Scripts/BoundaryManager.cs | 7 +++++-- .../Interactions/EditorInputSelector.cs | 16 ++++++++++------ .../Utilities/Interactions/ManualGazeControl.cs | 14 +++++++++----- .../Scripts/DebugPanelControllerInfo.cs | 14 +++++++------- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs b/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs index b4b0d0ec65d..025a2007af3 100644 --- a/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs +++ b/Assets/HoloToolkit/Boundary/Scripts/BoundaryManager.cs @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using System.Collections.Generic; using UnityEngine; -using UnityEngine.XR; #if UNITY_WSA +using System.Collections.Generic; using UnityEngine.XR.WSA; +using UnityEngine.XR; #endif namespace HoloToolkit.Unity.Boundary @@ -21,10 +21,12 @@ public class BoundaryManager : SingleInstance public GameObject FloorQuad; private GameObject floorQuadInstance; +#if UNITY_WSA [SerializeField] [Tooltip("Approximate max Y height of your space.")] private float boundaryHeight = 10f; private Bounds boundaryBounds; +#endif private bool renderFloor = true; public bool RenderFloor @@ -76,6 +78,7 @@ private void SetBoundaryRendering() UnityEngine.Experimental.XR.Boundary.visible = renderBoundary; } } + #if UNITY_WSA private void Awake() { diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs index ad3eb66a82f..aa1d3b8d653 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/EditorInputSelector.cs @@ -29,15 +29,19 @@ public class EditorInputSelector : MonoBehaviour private void Awake() { -#if UNITY_EDITOR - if (UnityEngine.XR.XRDevice.isPresent) + if (Application.isEditor) { -#endif - Destroy(gameObject); + if (UnityEngine.XR.XRDevice.isPresent) + { + Destroy(this); + return; + } + } + else + { + Destroy(this); return; -#if UNITY_EDITOR } -#endif Inputs = new List(); diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs index 58413f3aa4d..829d3118b00 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/ManualGazeControl.cs @@ -34,15 +34,19 @@ public class ManualGazeControl : MonoBehaviour private void Awake() { -#if UNITY_EDITOR - if (UnityEngine.XR.XRDevice.isPresent) + if (Application.isEditor) + { + if (UnityEngine.XR.XRDevice.isPresent) + { + Destroy(this); + return; + } + } + else { -#endif Destroy(this); return; -#if UNITY_EDITOR } -#endif cameraTransform = GetComponent().transform; if (cameraTransform == null) diff --git a/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs b/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs index 9d9c692625c..56ccfb5f0d8 100644 --- a/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs +++ b/Assets/HoloToolkit/Utilities/Scripts/DebugPanelControllerInfo.cs @@ -2,10 +2,10 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using System; -using System.Collections.Generic; using UnityEngine; #if UNITY_WSA +using System.Collections.Generic; using UnityEngine.XR.WSA.Input; #endif @@ -13,11 +13,10 @@ namespace HoloToolkit.Unity { public class DebugPanelControllerInfo : MonoBehaviour { +#if UNITY_WSA private class ControllerState { -#if UNITY_WSA public InteractionSourceHandedness Handedness; -#endif public Vector3 PointerPosition; public Quaternion PointerRotation; public Vector3 GripPosition; @@ -33,6 +32,9 @@ private class ControllerState public Vector2 TouchpadPosition; } + private Dictionary controllers; +#endif + // Text display label game objects public TextMesh LeftInfoTextPointerPosition; public TextMesh LeftInfoTextPointerRotation; @@ -61,13 +63,11 @@ private class ControllerState public TextMesh RightInfoTextTouchpadTouched; public TextMesh RightInfoTextTouchpadPosition; - private Dictionary controllers; - private void Awake() { +#if UNITY_WSA controllers = new Dictionary(); -#if UNITY_WSA InteractionManager.InteractionSourceDetected += InteractionManager_InteractionSourceDetected; InteractionManager.InteractionSourceLost += InteractionManager_InteractionSourceLost; @@ -126,7 +126,7 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate private string GetControllerInfo() { - string toReturn = ""; + string toReturn = string.Empty; #if UNITY_WSA foreach (ControllerState controllerState in controllers.Values) { From e2f019b903bd47777610a49c679d953d3e7fb9f8 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 14:51:17 -0700 Subject: [PATCH 18/25] Removed obsolete Keyword Manager and test class. --- .../Input/Scripts/DisplayKeywords.cs | 33 ---- .../Input/Scripts/DisplayKeywords.cs.meta | 12 -- .../Utilities/Managers/KeywordManager.cs | 179 ------------------ .../Utilities/Managers/KeywordManager.cs.meta | 12 -- 4 files changed, 236 deletions(-) delete mode 100644 Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs delete mode 100644 Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs.meta delete mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs delete mode 100644 Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs b/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs deleted file mode 100644 index 86aaf32ced8..00000000000 --- a/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using UnityEngine; -using UnityEngine.UI; - -namespace HoloToolkit.Unity.InputModule.Tests -{ - [Obsolete("See DisplaySpeechKeywords for updated usage.")] - public class DisplayKeywords : MonoBehaviour - { -#if UNITY_EDITOR || UNITY_WSA - public KeywordManager keywordManager; - public Text textPanel; - - private void Start() - { - if (keywordManager == null || textPanel == null) - { - Debug.Log("Please check the variables in the Inspector on DisplayKeywords.cs on" + name + "."); - return; - } - - textPanel.text = "Try saying:\n"; - foreach (KeywordManager.KeywordAndResponse k in keywordManager.KeywordsAndResponses) - { - textPanel.text += k.Keyword + "\n"; - } - } -#endif - } -} \ No newline at end of file diff --git a/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs.meta b/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs.meta deleted file mode 100644 index 02ef0005774..00000000000 --- a/Assets/HoloToolkit-Tests/Input/Scripts/DisplayKeywords.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 58bad4bea4d136b4b9f6534fae733f97 -timeCreated: 1471038703 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs deleted file mode 100644 index 74be52eb192..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Events; - -#if UNITY_WSA || UNITY_STANDALONE_WIN -using UnityEngine.Windows.Speech; -#endif - -namespace HoloToolkit.Unity.InputModule -{ - /// - /// KeywordManager allows you to specify keywords and methods in the Unity - /// Inspector, instead of registering them explicitly in code. - /// This also includes a setting to either automatically start the - /// keyword recognizer or allow your code to start it. - /// - /// IMPORTANT: Please make sure to add the microphone capability in your app, in Unity under - /// Edit -> Project Settings -> Player -> Settings for Windows Store -> Publishing Settings -> Capabilities - /// or in your Visual Studio Package.appxmanifest capabilities. - /// - [Obsolete("Use HoloToolkit.Unity.InputModule.SpeechInputSource")] - public partial class KeywordManager : MonoBehaviour - { - [System.Serializable] - public struct KeywordAndResponse - { - [Tooltip("The keyword to recognize.")] - public string Keyword; - [Tooltip("The KeyCode to recognize.")] - public KeyCode KeyCode; - [Tooltip("The UnityEvent to be invoked when the keyword is recognized.")] - public UnityEvent Response; - } - - // This enumeration gives the manager two different ways to handle the recognizer. Both will - // set up the recognizer and add all keywords. The first causes the recognizer to start - // immediately. The second allows the recognizer to be manually started at a later time. - public enum RecognizerStartBehavior { AutoStart, ManualStart }; - - [Tooltip("An enumeration to set whether the recognizer should start on or off.")] - public RecognizerStartBehavior RecognizerStart; - - [Tooltip("An array of string keywords and UnityEvents, to be set in the Inspector.")] - public KeywordAndResponse[] KeywordsAndResponses; - -#if UNITY_WSA || UNITY_STANDALONE_WIN - private readonly Dictionary responses = new Dictionary(); - - private KeywordRecognizer keywordRecognizer; - - void Start() - { - int keywordCount = KeywordsAndResponses.Length; - if (keywordCount > 0) - { - try - { - string[] keywords = new string[keywordCount]; - // Convert the struct array into a dictionary, with the keywords and the keys and the methods as the values. - // This helps easily link the keyword recognized to the UnityEvent to be invoked. - for (int index = 0; index < keywordCount; index++) - { - KeywordAndResponse keywordAndResponse = KeywordsAndResponses[index]; - responses[keywordAndResponse.Keyword] = keywordAndResponse.Response; - keywords[index] = keywordAndResponse.Keyword; - } - - keywordRecognizer = new KeywordRecognizer(keywords); - keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized; - - if (RecognizerStart == RecognizerStartBehavior.AutoStart) - { - keywordRecognizer.Start(); - } - } - catch (ArgumentException) - { - Debug.LogError("Duplicate keywords specified in the Inspector on " + gameObject.name + "."); - } - } - else - { - Debug.LogError("Must have at least one keyword specified in the Inspector on " + gameObject.name + "."); - } - } - - void Update() - { - if (keywordRecognizer != null && keywordRecognizer.IsRunning) - { - ProcessKeyBindings(); - } - } - - void OnDestroy() - { - if (keywordRecognizer != null) - { - StopKeywordRecognizer(); - keywordRecognizer.OnPhraseRecognized -= KeywordRecognizer_OnPhraseRecognized; - keywordRecognizer.Dispose(); - } - } - - void OnDisable() - { - if (keywordRecognizer != null) - { - StopKeywordRecognizer(); - } - } - - void OnEnable() - { - if (keywordRecognizer != null && RecognizerStart == RecognizerStartBehavior.AutoStart) - { - StartKeywordRecognizer(); - } - } -#endif - - private void ProcessKeyBindings() - { - foreach (var kvp in KeywordsAndResponses) - { - if (Input.GetKeyDown(kvp.KeyCode)) - { - kvp.Response.Invoke(); - return; - } - } - } - -#if UNITY_WSA || UNITY_STANDALONE_WIN - private void KeywordRecognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args) - { - UnityEvent keywordResponse; - - // Check to make sure the recognized keyword exists in the methods dictionary, then invoke the corresponding method. - if (responses.TryGetValue(args.text, out keywordResponse)) - { - keywordResponse.Invoke(); - } - } -#endif - - /// - /// Make sure the keyword recognizer is off, then start it. - /// Otherwise, leave it alone because it's already in the desired state. - /// - public void StartKeywordRecognizer() - { -#if UNITY_WSA || UNITY_STANDALONE_WIN - if (keywordRecognizer != null && !keywordRecognizer.IsRunning) - { - keywordRecognizer.Start(); - } -#endif - } - - /// - /// Make sure the keyword recognizer is on, then stop it. - /// Otherwise, leave it alone because it's already in the desired state. - /// - public void StopKeywordRecognizer() - { -#if UNITY_WSA || UNITY_STANDALONE_WIN - if (keywordRecognizer != null && keywordRecognizer.IsRunning) - { - keywordRecognizer.Stop(); - } -#endif - } - } -} \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta b/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta deleted file mode 100644 index 557b252145f..00000000000 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/Managers/KeywordManager.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3f2795b3e072e1745a4f8c670d64284f -timeCreated: 1455735877 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 4b5c9b722a1a1b36698f45d8204d8c24445ac890 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 14:51:31 -0700 Subject: [PATCH 19/25] nicer editor checking --- .../Input/Scripts/InputSources/EditorInputSource.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs index d3110a66e83..fe4da919856 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs @@ -251,16 +251,18 @@ public override bool TryGetMenu(uint sourceId, out bool isPressed) private void Awake() { -#if !UNITY_EDITOR - Destroy(gameObject); -#else + if (Application.isEditor) + { + Destroy(gameObject); + return; + } + manualController = GetComponent(); CurrentButtonStates = new ButtonStates(); currentlyVisible = false; visibilityChanged = false; controllerId = (uint)Random.value; -#endif } #if UNITY_EDITOR From 6931c74442f2637992244456ac3425832700c978 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 27 Sep 2017 15:03:29 -0700 Subject: [PATCH 20/25] Commented out ControllerInfo unimplemented controller components --- .../Input/Scripts/Utilities/ControllerInfo.cs | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs index 9f4bcd8be0c..b9506868262 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/ControllerInfo.cs @@ -11,9 +11,10 @@ namespace HoloToolkit.Unity.InputModule /// public class ControllerInfo : MonoBehaviour { - private GameObject home; - private Transform homePressed; - private Transform homeUnpressed; + // TODO: Implement all controller components. + //private GameObject home; + //private Transform homePressed; + //private Transform homeUnpressed; private GameObject menu; private Transform menuPressed; private Transform menuUnpressed; @@ -35,12 +36,12 @@ public class ControllerInfo : MonoBehaviour private GameObject touchpadPress; private Transform touchpadPressed; private Transform touchpadUnpressed; - private GameObject touchpadPressX; - private Transform touchpadPressXMin; - private Transform touchpadPressXMax; - private GameObject touchpadPressY; - private Transform touchpadPressYMin; - private Transform touchpadPressYMax; + //private GameObject touchpadPressX; + //private Transform touchpadPressXMin; + //private Transform touchpadPressXMax; + //private GameObject touchpadPressY; + //private Transform touchpadPressYMin; + //private Transform touchpadPressYMax; private GameObject touchpadTouchX; private Transform touchpadTouchXMin; private Transform touchpadTouchXMax; @@ -82,7 +83,7 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize switch (child.parent.name.ToLower()) { case "home": - homePressed = child; + //homePressed = child; break; case "menu": menuPressed = child; @@ -105,7 +106,7 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize switch (child.parent.name.ToLower()) { case "home": - homeUnpressed = child; + //homeUnpressed = child; break; case "menu": menuUnpressed = child; @@ -134,10 +135,10 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize thumbstickYMin = child; break; case "touchpad_press_x": - touchpadPressXMin = child; + //touchpadPressXMin = child; break; case "touchpad_press_y": - touchpadPressYMin = child; + //touchpadPressYMin = child; break; case "touchpad_touch_x": touchpadTouchXMin = child; @@ -157,10 +158,10 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize thumbstickYMax = child; break; case "touchpad_press_x": - touchpadPressXMax = child; + //touchpadPressXMax = child; break; case "touchpad_press_y": - touchpadPressYMax = child; + //touchpadPressYMax = child; break; case "touchpad_touch_x": touchpadTouchXMax = child; @@ -174,7 +175,7 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize switch (child.parent.name.ToLower()) { case "home": - home = child.gameObject; + //home = child.gameObject; break; case "menu": menu = child.gameObject; @@ -198,10 +199,10 @@ public void LoadInfo(Transform[] childTransforms, ControllerVisualizer visualize touchpadPress = child.gameObject; break; case "touchpad_press_x": - touchpadPressX = child.gameObject; + //touchpadPressX = child.gameObject; break; case "touchpad_press_y": - touchpadPressY = child.gameObject; + //touchpadPressY = child.gameObject; break; case "touchpad_touch_x": touchpadTouchX = child.gameObject; From 2a2339485abfb3ace711a865f37b6c01b608552e Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 2 Oct 2017 16:45:47 -0700 Subject: [PATCH 21/25] escaped comment ampersand --- .../HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs index fe4da919856..f93c4f3539a 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs @@ -496,7 +496,7 @@ private void SendControllerStateEvents(float time) } /// - /// Sends the events for hand visibility changes & controller connect/disconnect. + /// Sends the events for hand visibility changes & controller connect/disconnect. /// private void SendControllerVisibilityEvents() { From f239a81d1e6bcad2d5b438dff2adb1b405cfb159 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 3 Oct 2017 08:32:55 -0700 Subject: [PATCH 22/25] Updated Managers prefab --- .../HoloToolkit/Input/Prefabs/Managers.prefab | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Assets/HoloToolkit/Input/Prefabs/Managers.prefab b/Assets/HoloToolkit/Input/Prefabs/Managers.prefab index 27974588ee0..3cb451cb01b 100644 --- a/Assets/HoloToolkit/Input/Prefabs/Managers.prefab +++ b/Assets/HoloToolkit/Input/Prefabs/Managers.prefab @@ -37,6 +37,7 @@ GameObject: m_Component: - component: {fileID: 4275426119395772} - component: {fileID: 114915899085195412} + - component: {fileID: 114209566806921312} m_Layer: 0 m_Name: EventSystem m_TagString: Untagged @@ -235,8 +236,26 @@ MonoBehaviour: GamePadId: 50000 HoldStartedInterval: 2 HoldCompletedInterval: 3 - NavigateAroundXAxisName: ControllerLeftStickX - NavigateAroundYAxisName: ControllerLeftStickY + NavigateAroundXAxisName: CONTROLLER_LEFT_STICK_HORIZONTAL + NavigateAroundYAxisName: CONTROLLER_RIGHT_STICK_HORIZONTAL +--- !u!114 &114209566806921312 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1172620179631984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 --- !u!114 &114340833638015514 MonoBehaviour: m_ObjectHideFlags: 1 From df1a3c551fb1be0badb9495be2c93afdb37037f6 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 3 Oct 2017 11:04:14 -0700 Subject: [PATCH 23/25] updated gaze controls on mixed reality camera prefabs --- .../Input/Prefabs/MixedRealityCamera.prefab | 14 +++++++------- .../Input/Prefabs/MixedRealityCameraParent.prefab | 13 ++++++------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Assets/HoloToolkit/Input/Prefabs/MixedRealityCamera.prefab b/Assets/HoloToolkit/Input/Prefabs/MixedRealityCamera.prefab index 21e0cac4827..bdb1ca92a47 100644 --- a/Assets/HoloToolkit/Input/Prefabs/MixedRealityCamera.prefab +++ b/Assets/HoloToolkit/Input/Prefabs/MixedRealityCamera.prefab @@ -415,7 +415,6 @@ AudioListener: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1208988342737728} m_Enabled: 1 - m_ExtensionPropertyValues: [] --- !u!114 &114065736676316334 MonoBehaviour: m_ObjectHideFlags: 1 @@ -513,6 +512,7 @@ MonoBehaviour: m_EditorClassIdentifier: NearClipPlane_OpaqueDisplay: 0.1 CameraClearFlags_OpaqueDisplay: 1 + BackgroundColor_OpaqueDisplay: {r: 0, g: 0, b: 0, a: 1} OpaqueQualityLevel: 5 NearClipPlane_TransparentDisplay: 0.85 CameraClearFlags_TransparentDisplay: 2 @@ -573,8 +573,8 @@ MonoBehaviour: UseUnscaledTime: 1 axisType: 0 buttonType: 21 - InputManagerHorizontalAxisName: ControllerTriggerAxis - InputManagerVerticalAxisName: ControllerTriggerAxis + InputManagerHorizontalAxisName: CONTROLLER_LEFT_TRIGGER + InputManagerVerticalAxisName: CONTROLLER_RIGHT_TRIGGER Axis0Destination: 2 Axis1Destination: 2 Axis2Destination: 6 @@ -613,8 +613,8 @@ MonoBehaviour: UseUnscaledTime: 1 axisType: 0 buttonType: 21 - InputManagerHorizontalAxisName: ControllerLeftStickX - InputManagerVerticalAxisName: ControllerLeftStickY + InputManagerHorizontalAxisName: CONTROLLER_LEFT_STICK_HORIZONTAL + InputManagerVerticalAxisName: CONTROLLER_LEFT_STICK_VERTICAL Axis0Destination: 0 Axis1Destination: 5 Axis2Destination: 6 @@ -653,8 +653,8 @@ MonoBehaviour: UseUnscaledTime: 1 axisType: 0 buttonType: 21 - InputManagerHorizontalAxisName: ControllerRightStickX - InputManagerVerticalAxisName: ControllerRightStickY + InputManagerHorizontalAxisName: CONTROLLER_RIGHT_STICK_HORIZONTAL + InputManagerVerticalAxisName: CONTROLLER_RIGHT_STICK_VERTICAL Axis0Destination: 2 Axis1Destination: 0 Axis2Destination: 6 diff --git a/Assets/HoloToolkit/Input/Prefabs/MixedRealityCameraParent.prefab b/Assets/HoloToolkit/Input/Prefabs/MixedRealityCameraParent.prefab index b0cfa2dfe23..ac917be3e0b 100644 --- a/Assets/HoloToolkit/Input/Prefabs/MixedRealityCameraParent.prefab +++ b/Assets/HoloToolkit/Input/Prefabs/MixedRealityCameraParent.prefab @@ -579,7 +579,6 @@ AudioListener: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1372541880982678} m_Enabled: 1 - m_ExtensionPropertyValues: [] --- !u!114 &114029515443702222 MonoBehaviour: m_ObjectHideFlags: 1 @@ -595,8 +594,8 @@ MonoBehaviour: UseUnscaledTime: 1 axisType: 0 buttonType: 21 - InputManagerHorizontalAxisName: ControllerRightStickX - InputManagerVerticalAxisName: ControllerRightStickY + InputManagerHorizontalAxisName: CONTROLLER_RIGHT_STICK_HORIZONTAL + InputManagerVerticalAxisName: CONTROLLER_RIGHT_STICK_VERTICAL Axis0Destination: 0 Axis1Destination: 4 Axis2Destination: 6 @@ -851,8 +850,8 @@ MonoBehaviour: UseUnscaledTime: 1 axisType: 0 buttonType: 21 - InputManagerHorizontalAxisName: LeftTrigger - InputManagerVerticalAxisName: RightTrigger + InputManagerHorizontalAxisName: CONTROLLER_LEFT_TRIGGER + InputManagerVerticalAxisName: CONTROLLER_RIGHT_TRIGGER Axis0Destination: 2 Axis1Destination: 3 Axis2Destination: 6 @@ -891,8 +890,8 @@ MonoBehaviour: UseUnscaledTime: 1 axisType: 0 buttonType: 21 - InputManagerHorizontalAxisName: ControllerLeftStickX - InputManagerVerticalAxisName: ControllerLeftStickY + InputManagerHorizontalAxisName: CONTROLLER_LEFT_STICK_HORIZONTAL + InputManagerVerticalAxisName: CONTROLLER_LEFT_STICK_VERTICAL Axis0Destination: 2 Axis1Destination: 0 Axis2Destination: 6 From d9c1382e8168fed8634bdb78e5200d221ab201e4 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 3 Oct 2017 12:41:25 -0700 Subject: [PATCH 24/25] fixed flipped logic --- .../HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs index f93c4f3539a..d28ad028115 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/EditorInputSource.cs @@ -251,7 +251,7 @@ public override bool TryGetMenu(uint sourceId, out bool isPressed) private void Awake() { - if (Application.isEditor) + if (!Application.isEditor) { Destroy(gameObject); return; From af16c3f44cc545f8bb3a370c37d65d261ae02824 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 3 Oct 2017 13:24:36 -0700 Subject: [PATCH 25/25] Updated InputManager.asset download URL --- .../SharingWithUNET/UI/Scripts/StartSessionButton.cs | 2 +- .../Utilities/Scripts/Editor/ProjectSettingsWindow.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs index 9b8e1d99762..6583880e65e 100644 --- a/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs +++ b/Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs @@ -16,7 +16,7 @@ public class StartSessionButton : MonoBehaviour, IInputClickHandler private NetworkDiscoveryWithAnchors networkDiscovery; // Use this for initialization - void Start() + private void Start() { networkDiscovery = NetworkDiscoveryWithAnchors.Instance; diff --git a/Assets/HoloToolkit/Utilities/Scripts/Editor/ProjectSettingsWindow.cs b/Assets/HoloToolkit/Utilities/Scripts/Editor/ProjectSettingsWindow.cs index e8645d8efbc..986a4c05269 100644 --- a/Assets/HoloToolkit/Utilities/Scripts/Editor/ProjectSettingsWindow.cs +++ b/Assets/HoloToolkit/Utilities/Scripts/Editor/ProjectSettingsWindow.cs @@ -16,7 +16,7 @@ namespace HoloToolkit.Unity public class ProjectSettingsWindow : AutoConfigureWindow { private const string SharingServiceURL = "https://raw.githubusercontent.com/Microsoft/MixedRealityToolkit-Unity/master/External/HoloToolkit/Sharing/Server/SharingService.exe"; - private const string InputManagerAssetURL = "https://raw.githubusercontent.com/Microsoft/MixedRealityToolkit-Unity/master/ProjectSettings/InputManager.asset"; + private const string InputManagerAssetURL = "https://raw.githubusercontent.com/Microsoft/MixedRealityToolkit-Unity/Dev_Unity_2017.2.0/ProjectSettings/InputManager.asset"; #region Nested Types