private static void HandleOnPlayModeChanged() { if (EditorApplication.isPlaying && TobiiEulaFile.IsEulaAccepted() == false) { ShowWindow(); } }
//-------------------------------------------------------------------- // 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); }
static TobiiEulaCheck() { if (TobiiEulaFile.IsEulaAccepted() == false) { EditorApplication.update += Update; EditorApplication.playmodeStateChanged += HandleOnPlayModeChanged; } }
static TobiiEulaCheck() { if (TobiiEulaFile.IsEulaAccepted() == false) { EditorApplication.update += Update; #if UNITY_2017_2_OR_NEWER EditorApplication.playModeStateChanged += HandleOnPlayModeChanged; #else EditorApplication.playmodeStateChanged += HandleOnPlayModeChanged; #endif } }
public static bool IsEulaAccepted() { #if !UNITY_EDITOR if (_eulaFile == null) { _eulaFile = TobiiEulaFile.LoadEulaFile(); } #endif if (_eulaFile != null) { return(_eulaFile.IsEulaAccepted()); } return(false); }