Пример #1
0
    private void Awake()
    {
        // Get all objects of the type and save them to a list.
        _gazeGrabbableObjects = FindObjectsOfType <GazeGrabbableObject>();
        _gazeThrowTargets     = FindObjectsOfType <GazeThrowTarget>();

        var settings = TobiiXR_Settings.CreateDefaultSettings();

        // Create a custom G2OM description and set the layer mask to be used for switching between which objects should be focusable
        var description = new G2OM_Description
        {
            LayerMask = EnabledLayer << 1
        };

        _g2omInstance = G2OM.Create(description);
        settings.G2OM = _g2omInstance;

        // Get the G2OM visualization to be able to show what G2OM tries to map to.
        _visualization = GetComponent <G2OM_DebugVisualization>();

        TobiiXR.Start(settings);

        // Start by enabling the grabbable objects to receive focus from G2OM.
        EnableGrabbableObjects();
    }
        private void Awake()
        {
            // Get all objects of the type and save them to a list.
            _gazeGrabbableObjects = FindObjectsOfType <GazeGrabbableObject>();
            _gazeThrowTargets     = FindObjectsOfType <GazeThrowTarget>();

            // Create a custom G2OM description and set the layer mask to be used for switching between which objects should be focusable
            var description = new G2OM_Description
            {
                LayerMask = EnabledLayer << 1
            };

            _g2omInstance = G2OM.Create(description);
            Settings.G2OM = _g2omInstance;

            TobiiXR.Start(Settings);

            // Start by enabling the grabbable objects to receive focus from G2OM.
            EnableGrabbableObjects();
        }
Пример #3
0
        void Start()
        {
            var settings = TobiiXR_Settings.CreateDefaultSettings();

            var description = new G2OM_Description
            {
                HowLongToKeepCandidatesInSeconds = 0,
                ExpectedNumberOfObjects          = settings.ExpectedNumberOfObjects,
                ObjectFinder  = new G2OM_RegisterObjectsFinder(),
                Distinguisher = new G2OM_RegisterObjectDistinguisher(),
                LayerMask     = settings.LayerMask
            };

            settings.G2OM = G2OM.Create(description);

            if (DebugVisualization != null)
            {
                DebugVisualization.Setup(settings.G2OM, MainCamera);
                Debug.Log("G2OM debug visualization available.");
            }

            TobiiXR.Start(settings);
        }