コード例 #1
0
 private static void HandleOnPlayModeChanged()
 {
     if (EditorApplication.isPlaying && TobiiEulaFile.IsEulaAccepted() == false)
     {
         ShowWindow();
     }
 }
コード例 #2
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);
        }
コード例 #3
0
 static TobiiEulaCheck()
 {
     if (TobiiEulaFile.IsEulaAccepted() == false)
     {
         EditorApplication.update += Update;
         EditorApplication.playmodeStateChanged += HandleOnPlayModeChanged;
     }
 }
コード例 #4
0
        static TobiiEulaCheck()
        {
            if (TobiiEulaFile.IsEulaAccepted() == false)
            {
                EditorApplication.update += Update;
#if UNITY_2017_2_OR_NEWER
                EditorApplication.playModeStateChanged += HandleOnPlayModeChanged;
#else
                EditorApplication.playmodeStateChanged += HandleOnPlayModeChanged;
#endif
            }
        }
コード例 #5
0
        public static bool IsEulaAccepted()
        {
            #if !UNITY_EDITOR
            if (_eulaFile == null)
            {
                _eulaFile = TobiiEulaFile.LoadEulaFile();
            }
            #endif

            if (_eulaFile != null)
            {
                return(_eulaFile.IsEulaAccepted());
            }

            return(false);
        }