From d309b709ace1c02a00de50ee9e144b55777f01a4 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 30 Jan 2019 14:42:05 +0100 Subject: [PATCH] 2d demo: fixed an issue, which prevented to toggle the gaze visualization --- .../Assets/pupil_plugin/Scripts/CalibrationDemo.cs | 9 +++++++++ .../pupil_plugin/Scripts/Pupil/PupilGazeTracker.cs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/CalibrationDemo.cs b/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/CalibrationDemo.cs index a7982c1b..2a768e00 100644 --- a/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/CalibrationDemo.cs +++ b/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/CalibrationDemo.cs @@ -12,4 +12,13 @@ void OnEnable() print ("We are gazing"); } } + + void OnDisable() + { + if (PupilTools.IsConnected) + { + PupilGazeTracker.Instance.StopVisualizingGaze (); + print ("Stop visualizing gaze"); + } + } } diff --git a/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/Pupil/PupilGazeTracker.cs b/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/Pupil/PupilGazeTracker.cs index 2d11ac15..74ec0262 100644 --- a/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/Pupil/PupilGazeTracker.cs +++ b/unity_pupil_plugin_vr/Assets/pupil_plugin/Scripts/Pupil/PupilGazeTracker.cs @@ -235,7 +235,7 @@ public void StopVisualizingGaze () PupilMarker.TryToSetActive(_markerGazeCenter,false); PupilMarker.TryToSetActive(_gaze3D,false); - PupilTools.IsIdle = true; + // PupilTools.IsIdle = true; // PupilTools.UnSubscribeFrom("gaze"); }