Esempio n. 1
0
        //--------------------------------------------------------------------
        // Public Function and Properties
        //--------------------------------------------------------------------

        public static ITobiiHost GetInstance()
        {
            if (_isShuttingDown || !TobiiEulaFile.IsEulaAccepted())
            {
                if (!TobiiEulaFile.IsEulaAccepted() && !HasDisplayedEulaError)
                {
                    Debug.LogError(
                        "You need to accept EULA to be able to use Tobii Unity SDK.");
                    HasDisplayedEulaError = true;
                }

                return(new TobiiHostStub());
            }

            if (_instance != null)
            {
                return(_instance);
            }

            var newGameObject = new GameObject("TobiiHost");

            DontDestroyOnLoad(newGameObject);
            _instance = newGameObject.AddComponent <TobiiHost>();
            return(_instance);
        }
Esempio n. 2
0
        private void Initialize()
        {
            if (IsInitialized)
            {
                return;
            }

            ReloadSettings();
            var gazePointDataProvider =
                TobiiHost.GetInstance().GetGazePointDataProvider();

            gazePointDataProvider.Start(_identifier.GetInstanceID());

            if (Scorer == null)
            {
                Scorer = new SingleRaycastHistoricHitScore();
            }
            if (_multiScorer == null)
            {
                _multiScorer = new MultiRaycastHistoricHitScore();
            }

            IsInitialized = true;
        }