public IEnumerator TestGazeProviderDestroyed()
        {
            yield return(PlayModeTestUtilities.WaitForInputSystemUpdate());

            // remove the gaze provider and it's components from the scene
            GazeProvider gazeProvider = CoreServices.InputSystem.GazeProvider.GameObjectReference.GetComponent <GazeProvider>();

            gazeProvider.GazePointer.BaseCursor.Destroy();
            DebugUtilities.LogVerbose("Application was playing, destroyed the gaze pointer's BaseCursor");
            UnityObjectExtensions.DestroyObject(gazeProvider);
            gazeProvider = null;

            // Ensure that the input system and it's related input sources are able to be reinitialized without issue.
            yield return(PlayModeTestUtilities.WaitForInputSystemUpdate());

            PlayModeTestUtilities.GetInputSystem().Initialize();

            yield return(PlayModeTestUtilities.WaitForInputSystemUpdate());

            yield return(null);
        }
Example #2
0
 private Cursor(GameObject prefab, GazeProvider provider)
 {
     cursorObj     = GameObject.Instantiate(prefab);
     this.provider = provider;
 }
Example #3
0
 /// <summary>
 /// Creates a Cursor Singleton
 /// </summary>
 /// <param name="cursorPrefab"></param>
 /// <param name="provider"></param>
 public static void Instantiate(GameObject cursorPrefab, GazeProvider provider)
 => instance = new Cursor(cursorPrefab, provider);
Example #4
0
 private void Start()
 {
     gazeProvider = FindObjectOfType <GazeProvider>();
     //closeMenu();
     openMenu();
 }