//-------------------------------------------------------------------- // Public Function and Properties //-------------------------------------------------------------------- public static ITobiiHost GetInstance() { if (_isShuttingDown) { return(new Stubs.TobiiHostStub()); } #if UNITY_EDITOR if (!(UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows64 || UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows)) { return(new Stubs.TobiiHostStub()); } #endif if (!TobiiEulaFile.IsEulaAccepted()) { if (!_hasDisplayedEulaError) { Debug.LogWarning("You need to accept EULA to be able to use Tobii Unity SDK."); _hasDisplayedEulaError = true; } return(new Stubs.TobiiHostStub()); } if (_instance != null) { return(_instance); } var newGameObject = new GameObject("TobiiHost"); DontDestroyOnLoad(newGameObject); _instance = newGameObject.AddComponent <TobiiHost>(); return(_instance); }
private void Initialize() { if (_isInitialized) { return; } ReloadSettings(); var gazePointDataProvider = TobiiHost.GetInstance().GetGazePointDataProvider(); gazePointDataProvider.Start(_identifier.GetInstanceID()); if (Scorer == null) { //Scorer = new SingleRayCastNoScore(); Scorer = new SingleRaycastHistoricHitScore(); //Scorer = new MultiRaycastHistoricHitScore(); } if (_multiScorer == null) { _multiScorer = new MultiRaycastHistoricHitScore(); } _isInitialized = true; }
//-------------------------------------------------------------------- // 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 Stubs.TobiiHostStub(); //} if (_instance != null) { return(_instance); } var newGameObject = new GameObject("TobiiHost"); DontDestroyOnLoad(newGameObject); _instance = newGameObject.AddComponent <TobiiHost>(); return(_instance); }