Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. public class DisableInputSystemTest : MonoBehaviour
  2. {
  3. private IMixedRealityInputSystem inputSystem = null;
  4. private IMixedRealityInputSystem InputSystem
  5. {
  6. get
  7. {
  8. if (inputSystem == null)
  9. {
  10. MixedRealityServiceRegistry.TryGetService<IMixedRealityInputSystem>(out inputSystem);
  11. }
  12. return inputSystem;
  13. }
  14. }
  15.  
  16. public void DisableInputSystem()
  17. {
  18. InputSystem.Disable();
  19. }
  20.  
  21. public void EnableInputSystem()
  22. {
  23. InputSystem.Enable();
  24. }
  25. }
  26.  
  27. MixedRealityInputSystemProfile profile = ConfigurationProfile as MixedRealityInputSystemProfile;
  28.  
  29. if (profile.PointerProfile != null)
  30. {
  31. if (profile.PointerProfile.GazeProviderType?.Type != null)
  32. {
  33. GazeProvider = CameraCache.Main.gameObject.EnsureComponent(profile.PointerProfile.GazeProviderType.Type) as IMixedRealityGazeProvider;
  34. GazeProvider.GazeCursorPrefab = profile.PointerProfile.GazeCursorPrefab;
  35. // Current implementation implements both provider types in one concrete class.
  36. EyeGazeProvider = GazeProvider as IMixedRealityEyeGazeProvider;
  37. }
  38. else
  39. {
  40. Debug.LogError("The Input system is missing the required GazeProviderType!");
  41. return;
  42. }
  43. }
  44. else
  45. {
  46. Debug.LogError("The Input system is missing the required Pointer Profile!");
  47. return;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement