@@ -45,8 +45,11 @@ public class InputManager : Singleton<InputManager>
45
45
private ManipulationEventData manipulationEventData ;
46
46
private HoldEventData holdEventData ;
47
47
private NavigationEventData navigationEventData ;
48
+
49
+ #if UNITY_WSA || UNITY_STANDALONE_WIN
48
50
private SpeechKeywordRecognizedEventData speechKeywordRecognizedEventData ;
49
51
private DictationEventData dictationEventData ;
52
+ #endif
50
53
51
54
/// <summary>
52
55
/// Indicates if input is currently enabled or not.
@@ -184,11 +187,13 @@ private void InitializeEventDatas()
184
187
manipulationEventData = new ManipulationEventData ( EventSystem . current ) ;
185
188
navigationEventData = new NavigationEventData ( EventSystem . current ) ;
186
189
holdEventData = new HoldEventData ( EventSystem . current ) ;
190
+ #if UNITY_WSA || UNITY_STANDALONE_WIN
187
191
speechKeywordRecognizedEventData = new SpeechKeywordRecognizedEventData ( EventSystem . current ) ;
188
192
dictationEventData = new DictationEventData ( EventSystem . current ) ;
193
+ #endif
189
194
}
190
195
191
- #region Unity Methods
196
+ #region Unity Methods
192
197
193
198
private void Start ( )
194
199
{
@@ -217,7 +222,7 @@ protected override void OnDestroy()
217
222
UnregisterGazeManager ( ) ;
218
223
}
219
224
220
- #endregion // Unity Methods
225
+ #endregion // Unity Methods
221
226
222
227
public void HandleEvent < T > ( BaseEventData eventData , ExecuteEvents . EventFunction < T > eventHandler )
223
228
where T : IEventSystemHandler
@@ -450,7 +455,7 @@ public void RaiseSourceLost(IInputSource source, uint sourceId)
450
455
HandleEvent ( sourceStateEventData , OnSourceLostEventHandler ) ;
451
456
}
452
457
453
- #region Manipulation Events
458
+ #region Manipulation Events
454
459
455
460
private static readonly ExecuteEvents . EventFunction < IManipulationHandler > OnManipulationStartedEventHandler =
456
461
delegate ( IManipulationHandler handler , BaseEventData eventData )
@@ -516,9 +521,9 @@ public void RaiseManipulationCanceled(IInputSource source, uint sourceId, Vector
516
521
HandleEvent ( manipulationEventData , OnManipulationCanceledEventHandler ) ;
517
522
}
518
523
519
- #endregion // Manipulation Events
524
+ #endregion // Manipulation Events
520
525
521
- #region Hold Events
526
+ #region Hold Events
522
527
523
528
private static readonly ExecuteEvents . EventFunction < IHoldHandler > OnHoldStartedEventHandler =
524
529
delegate ( IHoldHandler handler , BaseEventData eventData )
@@ -568,9 +573,9 @@ public void RaiseHoldCanceled(IInputSource source, uint sourceId)
568
573
HandleEvent ( holdEventData , OnHoldCanceledEventHandler ) ;
569
574
}
570
575
571
- #endregion // Hold Events
576
+ #endregion // Hold Events
572
577
573
- #region Navigation Events
578
+ #region Navigation Events
574
579
575
580
private static readonly ExecuteEvents . EventFunction < INavigationHandler > OnNavigationStartedEventHandler =
576
581
delegate ( INavigationHandler handler , BaseEventData eventData )
@@ -636,10 +641,10 @@ public void RaiseNavigationCanceled(IInputSource source, uint sourceId, Vector3
636
641
HandleEvent ( navigationEventData , OnNavigationCanceledEventHandler ) ;
637
642
}
638
643
639
- #endregion // Navigation Events
644
+ #endregion // Navigation Events
640
645
641
646
#if UNITY_WSA || UNITY_STANDALONE_WIN
642
- #region Speech Events
647
+ #region Speech Events
643
648
644
649
private static readonly ExecuteEvents . EventFunction < ISpeechHandler > OnSpeechKeywordRecognizedEventHandler =
645
650
delegate ( ISpeechHandler handler , BaseEventData eventData )
@@ -664,9 +669,9 @@ public void RaiseSpeechKeywordPhraseRecognized(IInputSource source, uint sourceI
664
669
handler . OnDictationHypothesis ( casted ) ;
665
670
} ;
666
671
667
- #endregion // Speech Events
672
+ #endregion // Speech Events
668
673
669
- #region Dictation Events
674
+ #region Dictation Events
670
675
671
676
public void RaiseDictationHypothesis ( IInputSource source , uint sourceId , string dictationHypothesis , AudioClip dictationAudioClip = null )
672
677
{
@@ -725,7 +730,7 @@ public void RaiseDictationError(IInputSource source, uint sourceId, string dicta
725
730
HandleEvent ( dictationEventData , OnDictationErrorEventHandler ) ;
726
731
}
727
732
728
- #endregion // Dictation Events
733
+ #endregion // Dictation Events
729
734
#endif
730
735
}
731
736
}
0 commit comments