MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Clear access to GazeTarget of GazeProvider

Open Kent1LG opened this issue 7 years ago • 0 comments

Documentation Issue

Missing a explanation of how you can access to "GazeTarget" from "GazeProvider" class.

Here is an access sample provide by "Will W" on slack HoloDevelopers :

`using Microsoft.MixedReality.Toolkit; using Microsoft.MixedReality.Toolkit.Input; using System.Collections; using System.Collections.Generic; using UnityEngine;

public class GazeTest : MonoBehaviour { private IMixedRealityInputSystem inputSystem = null;

// The active instance of the input system. protected IMixedRealityInputSystem InputSystem { get { if (inputSystem == null) { MixedRealityServiceRegistry.TryGetService(out inputSystem); } return inputSystem; } }

// Update is called once per frame void Update() { // Log something every 60 frames. if (Time.frameCount % 60 == 0) { Debug.Log("Current gazed target: " + InputSystem.GazeProvider.GazeTarget); } } }`

Existing Doc Link

https://microsoft.github.io/MixedRealityToolkit-Unity/api/Microsoft.MixedReality.Toolkit.Input.GazeProvider.html

Kent1LG avatar Jul 17 '19 07:07 Kent1LG