private static void HandleOnPlayModeChanged() #endif { if (EditorApplication.isPlaying && TobiiEulaFile.IsEulaAccepted() == false) { ShowWindow(); } }
private static void TobiiEulaChecker() { if (TobiiEulaFile.IsEulaAccepted() == false) { EditorApplication.update += Update; #if UNITY_2017_2_OR_NEWER EditorApplication.playModeStateChanged += HandleOnPlayModeChanged; #else EditorApplication.playmodeStateChanged += HandleOnPlayModeChanged; #endif } }
public static bool Start(TobiiXR_Settings settings = null) { if (!TobiiEulaFile.IsEulaAccepted()) { Debug.LogError("You need to accept Tobii Software Development License Agreement to be able to use Tobii XR Unity SDK."); return(false); } if (_eyeTrackingProvider != null) { Debug.LogWarning(string.Format("TobiiXR already started with provider ({0})", _eyeTrackingProvider)); VerifyInstanceIntegrity(); return(false); } if (settings == null) { settings = TobiiXR_Settings.CreateDefaultSettings(); } if (settings.FieldOfUse == FieldOfUse.NotSelected) { //For more info, see https://developer.tobii.com/vr/develop/unity/documentation/configure-tobii-xr/ Debug.LogError("Field of use has not been selected. Please specify intended field of use in TobiiXR_Settings (can also be edited in Window->Tobii->Tobii Settings)"); } _eyeTrackingProvider = settings.EyeTrackingProvider; if (_eyeTrackingProvider == null) { _eyeTrackingProvider = new NoseDirectionProvider(); Debug.LogWarning(string.Format("Creating ({0}) failed. Using ({1}) as fallback", settings.GetProviderType(), _eyeTrackingProvider.GetType().Name)); } Debug.Log(string.Format("Starting TobiiXR with ({0}) as provider for eye tracking", _eyeTrackingProvider)); Internal.Settings = settings; Internal.G2OM = settings.G2OM; VerifyInstanceIntegrity(); return(true); }