Skip to content

Commit f2ff449

Browse files
authored
Merge pull request #330 from maxouellet/ExtensibleInputModule
IInputHandler interface split + fixes
2 parents 2f6721c + b01d7cc commit f2ff449

File tree

25 files changed

+367
-541
lines changed

25 files changed

+367
-541
lines changed

Assets/HoloToolkit-Examples/ColorPicker/GazeableColorPicker.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using HoloToolkit.Unity.InputModule;
22
using UnityEngine;
3-
using UnityEngine.UI;
43
using UnityEngine.Events;
54

65
namespace Lighthouse
76
{
8-
public class GazeableColorPicker : MonoBehaviour, IFocusable, IInputHandler
7+
public class GazeableColorPicker : MonoBehaviour, IFocusable, IInputClickHandler
98
{
109
public Renderer rendererComponent;
1110

@@ -47,16 +46,6 @@ public void OnFocusExit()
4746
gazing = false;
4847
}
4948

50-
public void OnInputUp(InputEventData eventData)
51-
{
52-
// Nothing to do
53-
}
54-
55-
public void OnInputDown(InputEventData eventData)
56-
{
57-
// Nothing to do
58-
}
59-
6049
public void OnInputClicked(InputEventData eventData)
6150
{
6251
UpdatePickedColor(OnPickedColor);

Assets/HoloToolkit-Examples/GazeRuler/Scripts/MeasureManager.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// <summary>
99
/// manager all measure tools here
1010
/// </summary>
11-
public class MeasureManager : Singleton<MeasureManager>, IHoldHandler, IInputHandler
11+
public class MeasureManager : Singleton<MeasureManager>, IHoldHandler, IInputClickHandler
1212
{
1313
private IGeometry manager;
1414
public GeometryMode Mode;
@@ -99,16 +99,6 @@ public void OnHoldCanceled(HoldEventData eventData)
9999
// Nothing to do
100100
}
101101

102-
public void OnInputUp(InputEventData eventData)
103-
{
104-
// Nothing to do
105-
}
106-
107-
public void OnInputDown(InputEventData eventData)
108-
{
109-
// Nothing to do
110-
}
111-
112102
public void OnInputClicked(InputEventData eventData)
113103
{
114104
OnSelect();

Assets/HoloToolkit-Examples/SharingWithUNET/Scenes/sharingwithunet.unity

Lines changed: 95 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -93,81 +93,6 @@ NavMeshSettings:
9393
cellSize: 0.16666667
9494
manualCellSize: 0
9595
m_NavMeshData: {fileID: 0}
96-
--- !u!1001 &319895707
97-
Prefab:
98-
m_ObjectHideFlags: 0
99-
serializedVersion: 2
100-
m_Modification:
101-
m_TransformParent: {fileID: 0}
102-
m_Modifications:
103-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
104-
propertyPath: m_LocalPosition.x
105-
value: 0
106-
objectReference: {fileID: 0}
107-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
108-
propertyPath: m_LocalPosition.y
109-
value: 0
110-
objectReference: {fileID: 0}
111-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
112-
propertyPath: m_LocalPosition.z
113-
value: 0
114-
objectReference: {fileID: 0}
115-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
116-
propertyPath: m_LocalRotation.x
117-
value: 0
118-
objectReference: {fileID: 0}
119-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
120-
propertyPath: m_LocalRotation.y
121-
value: 0
122-
objectReference: {fileID: 0}
123-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
124-
propertyPath: m_LocalRotation.z
125-
value: 0
126-
objectReference: {fileID: 0}
127-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
128-
propertyPath: m_LocalRotation.w
129-
value: 1
130-
objectReference: {fileID: 0}
131-
- target: {fileID: 402774, guid: b84b73491ac53a34095000876132a211, type: 2}
132-
propertyPath: m_RootOrder
133-
value: 1
134-
objectReference: {fileID: 0}
135-
- target: {fileID: 2035550, guid: b84b73491ac53a34095000876132a211, type: 2}
136-
propertyPath: near clip plane
137-
value: 0.3
138-
objectReference: {fileID: 0}
139-
m_RemovedComponents: []
140-
m_ParentPrefab: {fileID: 100100000, guid: b84b73491ac53a34095000876132a211, type: 2}
141-
m_IsPrefabParent: 0
142-
--- !u!1 &455133509 stripped
143-
GameObject:
144-
m_PrefabParentObject: {fileID: 190680, guid: b84b73491ac53a34095000876132a211, type: 2}
145-
m_PrefabInternal: {fileID: 319895707}
146-
--- !u!114 &455133510
147-
MonoBehaviour:
148-
m_ObjectHideFlags: 0
149-
m_PrefabParentObject: {fileID: 0}
150-
m_PrefabInternal: {fileID: 0}
151-
m_GameObject: {fileID: 455133509}
152-
m_Enabled: 1
153-
m_EditorHideFlags: 0
154-
m_Script: {fileID: 11500000, guid: 120ba207cff42584584563bcf18c124f, type: 3}
155-
m_Name:
156-
m_EditorClassIdentifier:
157-
ExtraMouseSensitivityScale: 3
158-
DefaultMouseSensitivity: 0.1
159-
MouseLookButton: 4
160-
IsControllerLookInverted: 1
161-
CurrentControlMode: 0
162-
FastControlKey: 305
163-
ControlSlowSpeed: 0.1
164-
ControlFastSpeed: 1
165-
MoveHorizontal: Horizontal
166-
MoveVertical: Vertical
167-
MouseX: Mouse X
168-
MouseY: Mouse Y
169-
LookHorizontal: LookHorizontal
170-
LookVertical: LookVertical
17196
--- !u!1 &543313553
17297
GameObject:
17398
m_ObjectHideFlags: 0
@@ -260,7 +185,7 @@ Transform:
260185
m_Children:
261186
- {fileID: 1499115225}
262187
m_Father: {fileID: 0}
263-
m_RootOrder: 5
188+
m_RootOrder: 4
264189
--- !u!114 &942915101
265190
MonoBehaviour:
266191
m_ObjectHideFlags: 0
@@ -280,8 +205,6 @@ GameObject:
280205
serializedVersion: 4
281206
m_Component:
282207
- 4: {fileID: 987084766}
283-
- 114: {fileID: 987084765}
284-
- 114: {fileID: 987084764}
285208
- 114: {fileID: 987084768}
286209
- 114: {fileID: 987084769}
287210
m_Layer: 0
@@ -291,38 +214,6 @@ GameObject:
291214
m_NavMeshLayer: 0
292215
m_StaticEditorFlags: 0
293216
m_IsActive: 1
294-
--- !u!114 &987084764
295-
MonoBehaviour:
296-
m_ObjectHideFlags: 0
297-
m_PrefabParentObject: {fileID: 0}
298-
m_PrefabInternal: {fileID: 0}
299-
m_GameObject: {fileID: 987084763}
300-
m_Enabled: 1
301-
m_EditorHideFlags: 0
302-
m_Script: {fileID: 11500000, guid: 94c1fd2ccb6e3e5449429462b44a8229, type: 3}
303-
m_Name:
304-
m_EditorClassIdentifier:
305-
keyboardSelectKey: 32
306-
MouseSelectButton: 1
307-
--- !u!114 &987084765
308-
MonoBehaviour:
309-
m_ObjectHideFlags: 0
310-
m_PrefabParentObject: {fileID: 0}
311-
m_PrefabInternal: {fileID: 0}
312-
m_GameObject: {fileID: 987084763}
313-
m_Enabled: 1
314-
m_EditorHideFlags: 0
315-
m_Script: {fileID: 11500000, guid: 4d1a2a33ffcac354298137001635a001, type: 3}
316-
m_Name:
317-
m_EditorClassIdentifier:
318-
MaxGazeDistance: 15
319-
RaycastLayerMask:
320-
serializedVersion: 2
321-
m_Bits: 4294967291
322-
SetStabilizationPlane: 1
323-
LerpStabilizationPlanePowerCloser: 4
324-
LerpStabilizationPlanePowerFarther: 7
325-
UseBuiltInGazeStabilization: 1
326217
--- !u!4 &987084766
327218
Transform:
328219
m_ObjectHideFlags: 0
@@ -333,9 +224,10 @@ Transform:
333224
m_LocalPosition: {x: 0, y: 0, z: 0}
334225
m_LocalScale: {x: 1, y: 1, z: 1}
335226
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
336-
m_Children: []
227+
m_Children:
228+
- {fileID: 1943070928}
337229
m_Father: {fileID: 0}
338-
m_RootOrder: 3
230+
m_RootOrder: 2
339231
--- !u!114 &987084768
340232
MonoBehaviour:
341233
m_ObjectHideFlags: 0
@@ -396,7 +288,7 @@ Prefab:
396288
objectReference: {fileID: 0}
397289
- target: {fileID: 4000013973311998, guid: 2bb0375303b23a34b8f642bbf61f1a9d, type: 2}
398290
propertyPath: m_RootOrder
399-
value: 4
291+
value: 3
400292
objectReference: {fileID: 0}
401293
m_RemovedComponents: []
402294
m_ParentPrefab: {fileID: 100100000, guid: 2bb0375303b23a34b8f642bbf61f1a9d, type: 2}
@@ -615,4 +507,93 @@ Transform:
615507
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
616508
m_Children: []
617509
m_Father: {fileID: 0}
618-
m_RootOrder: 2
510+
m_RootOrder: 1
511+
--- !u!1001 &1943070927
512+
Prefab:
513+
m_ObjectHideFlags: 0
514+
serializedVersion: 2
515+
m_Modification:
516+
m_TransformParent: {fileID: 987084766}
517+
m_Modifications:
518+
- target: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
519+
propertyPath: m_LocalPosition.x
520+
value: 0
521+
objectReference: {fileID: 0}
522+
- target: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
523+
propertyPath: m_LocalPosition.y
524+
value: 0
525+
objectReference: {fileID: 0}
526+
- target: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
527+
propertyPath: m_LocalPosition.z
528+
value: 0
529+
objectReference: {fileID: 0}
530+
- target: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
531+
propertyPath: m_LocalRotation.x
532+
value: 0
533+
objectReference: {fileID: 0}
534+
- target: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
535+
propertyPath: m_LocalRotation.y
536+
value: 0
537+
objectReference: {fileID: 0}
538+
- target: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
539+
propertyPath: m_LocalRotation.z
540+
value: 0
541+
objectReference: {fileID: 0}
542+
- target: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
543+
propertyPath: m_LocalRotation.w
544+
value: 1
545+
objectReference: {fileID: 0}
546+
- target: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
547+
propertyPath: m_RootOrder
548+
value: 0
549+
objectReference: {fileID: 0}
550+
m_RemovedComponents: []
551+
m_ParentPrefab: {fileID: 100100000, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
552+
m_IsPrefabParent: 0
553+
--- !u!4 &1943070928 stripped
554+
Transform:
555+
m_PrefabParentObject: {fileID: 4000011656901714, guid: 3eddd1c29199313478dd3f912bfab2ab,
556+
type: 2}
557+
m_PrefabInternal: {fileID: 1943070927}
558+
--- !u!1001 &1993010841
559+
Prefab:
560+
m_ObjectHideFlags: 0
561+
serializedVersion: 2
562+
m_Modification:
563+
m_TransformParent: {fileID: 0}
564+
m_Modifications:
565+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
566+
propertyPath: m_LocalPosition.x
567+
value: 0
568+
objectReference: {fileID: 0}
569+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
570+
propertyPath: m_LocalPosition.y
571+
value: 0
572+
objectReference: {fileID: 0}
573+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
574+
propertyPath: m_LocalPosition.z
575+
value: 0
576+
objectReference: {fileID: 0}
577+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
578+
propertyPath: m_LocalRotation.x
579+
value: 0
580+
objectReference: {fileID: 0}
581+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
582+
propertyPath: m_LocalRotation.y
583+
value: 0
584+
objectReference: {fileID: 0}
585+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
586+
propertyPath: m_LocalRotation.z
587+
value: 0
588+
objectReference: {fileID: 0}
589+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
590+
propertyPath: m_LocalRotation.w
591+
value: 1
592+
objectReference: {fileID: 0}
593+
- target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
594+
propertyPath: m_RootOrder
595+
value: 5
596+
objectReference: {fileID: 0}
597+
m_RemovedComponents: []
598+
m_ParentPrefab: {fileID: 100100000, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2}
599+
m_IsPrefabParent: 0

Assets/HoloToolkit-Examples/SharingWithUNET/Scripts/PlayerController.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
using UnityEngine;
55
using UnityEngine.Networking;
6-
using HoloToolkit.Unity;
6+
using HoloToolkit.Unity.InputModule;
77

88
namespace HoloToolkit.Examples.SharingWithUNET
99
{
1010
/// <summary>
1111
/// Controls player behavior (local and remote).
1212
/// </summary>
1313
[NetworkSettings(sendInterval = 0.033f)]
14-
public class PlayerController : NetworkBehaviour
14+
public class PlayerController : NetworkBehaviour, IInputClickHandler
1515
{
1616
/// <summary>
1717
/// The game object that represents the 'bullet' for
@@ -65,7 +65,7 @@ private void Start()
6565
{
6666
// If we are the local player then we want to have airtaps
6767
// sent to this object so that projeciles can be spawned.
68-
GestureManager.Instance.OverrideFocusedObject = this.gameObject;
68+
InputManager.Instance.AddGlobalListener(gameObject);
6969

7070
}
7171
else
@@ -111,17 +111,6 @@ public override void OnStartLocalPlayer()
111111
GetComponentInChildren<MeshRenderer>().material.color = Color.blue;
112112
}
113113

114-
/// <summary>
115-
/// Called by the gesture manager when an airtap is seen.
116-
/// </summary>
117-
void OnSelect()
118-
{
119-
if (isLocalPlayer)
120-
{
121-
CmdFire();
122-
}
123-
}
124-
125114
/// <summary>
126115
/// Called on the host when a bullet needs to be added.
127116
/// This will 'spawn' the bullet on all clients, including the
@@ -141,5 +130,13 @@ void CmdFire()
141130
// Clean up the bullet in 8 seconds.
142131
Destroy(nextBullet, 8.0f);
143132
}
133+
134+
public void OnInputClicked(InputEventData eventData)
135+
{
136+
if (isLocalPlayer)
137+
{
138+
CmdFire();
139+
}
140+
}
144141
}
145142
}

Assets/HoloToolkit-Examples/SpatialUnderstanding/SpatialUnderstanding-FeatureOverview/Scripts/AppState.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System;
77
using HoloToolkit.Unity.InputModule;
88

9-
public class AppState : Singleton<AppState>, ISourceStateHandler, IInputHandler
9+
public class AppState : Singleton<AppState>, ISourceStateHandler, IInputClickHandler
1010
{
1111
// Consts
1212
public float kMinAreaForStats = 5.0f;
@@ -252,16 +252,6 @@ public void OnSourceLost(SourceStateEventData eventData)
252252
}
253253
}
254254

255-
public void OnInputUp(InputEventData eventData)
256-
{
257-
// Nothing to do
258-
}
259-
260-
public void OnInputDown(InputEventData eventData)
261-
{
262-
// Nothing to do
263-
}
264-
265255
public void OnInputClicked(InputEventData eventData)
266256
{
267257
if ((SpatialUnderstanding.Instance.ScanState == SpatialUnderstanding.ScanStates.Scanning) &&

0 commit comments

Comments
 (0)